Skip to content

fix(cncn_Zdic): adapt to new zdic.net HTML structure - #368

Open
ankopala wants to merge 1 commit into
ninja33:masterfrom
ankopala:fix-zdic-selector
Open

ankopala wants to merge 1 commit into
ninja33:masterfrom
ankopala:fix-zdic-selector

Conversation

@ankopala

Copy link
Copy Markdown

Problem

cncn_Zdic no longer works — selecting a Chinese character triggers no popup, with no error in the console.

Root cause

zdic.net has redesigned its dictionary pages. The script relied on a single .jbjs container, which no longer exists in the new markup, so querySelector returns null and the script silently returns an empty result.

Changes

Rewrote findZdic to scrape the new jbjs-* structure:

  • reading (headword + pinyin + zhuyin)
  • basic senses with example sentences (respecting maxexample)
  • classical/archaic senses via gy-sense__def

Also converted maxexample with Number() in setOptions, and added a small renderCSS().

Verification

All new selectors verified against the live zdic.net page for (pinyin, zhuyin, 7 senses, 7 example groups, 16 classical senses). The script still satisfies the loader's eval contract.

Only src/dict/cncn_Zdic.js is changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant