From 3d7f5d343246db997bfa10f126f68bc99afd6ac1 Mon Sep 17 00:00:00 2001 From: Kevin Deng Date: Thu, 20 Aug 2026 16:37:02 +0900 Subject: [PATCH] Add Zi.tools links to character references (#25) --- scripts/tests/chars.test.ts | 7 +++++-- shared/links.ts | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/tests/chars.test.ts b/scripts/tests/chars.test.ts index d6b0fed..58a5fe2 100644 --- a/scripts/tests/chars.test.ts +++ b/scripts/tests/chars.test.ts @@ -214,10 +214,10 @@ describe('per-region stroke counts', () => { describe('outside references', () => { it('lists every character in the group, each with the full set', () => { - // 國 is written 国 and 國; both get all seven references + // 國 is written 国 and 國; both get all eight references const groups = dictGroups(row('國')) expect(groups.map((g) => g.form.char)).toEqual(['国', '國']) - expect(groups.every((g) => g.links.length === 7)).toBe(true) + expect(groups.every((g) => g.links.length === 8)).toBe(true) }) it('counts a name the group merged with as a character of its own', () => { @@ -234,6 +234,9 @@ describe('outside references', () => { expect(links.get('zdic')).toContain(encodeURIComponent('國')) expect(links.get('moedict')).toContain(encodeURIComponent('國')) expect(links.get('jisho')).toContain(encodeURIComponent('國')) + expect(links.get('zitools')).toBe( + `https://zi.tools/zi/${encodeURIComponent('國')}`, + ) expect(links.get('unihan')).toContain('codepoint=570B') }) diff --git a/shared/links.ts b/shared/links.ts index b5aa9fc..a49bd61 100644 --- a/shared/links.ts +++ b/shared/links.ts @@ -91,6 +91,11 @@ export function dictLinks(char: string): DictLink[] { region: 'jp', url: `https://jisho.org/search/${enc(char)}%20%23kanji`, }, + { + id: 'zitools', + name: '字統网', + url: `https://zi.tools/zi/${enc(char)}`, + }, { id: 'wiktionary', name: 'Wiktionary', -- 2.51.2