Skip to content

fix(zhihu): decode numeric entities in text output#1695

Merged
jackwener merged 2 commits into
jackwener:mainfrom
lenovobenben:fix/zhihu-text-entities
May 25, 2026
Merged

fix(zhihu): decode numeric entities in text output#1695
jackwener merged 2 commits into
jackwener:mainfrom
lenovobenben:fix/zhihu-text-entities

Conversation

@lenovobenben

Copy link
Copy Markdown
Contributor

Summary

  • add a shared Zhihu text helper for HTML stripping and entity decoding
  • decode decimal and hex numeric entities in search, question, and collection list output
  • keep answer-detail and answer-comments paragraph-preserving behavior while reusing the shared helper

Why

Some Zhihu API fields include numeric HTML entities such as " and &. Search/question/collection output could expose those raw entities even though answer-detail already decoded them.

Validation

  • npx vitest run --project adapter clis/zhihu/text.test.js clis/zhihu/search.test.js clis/zhihu/question.test.js clis/zhihu/collection.test.js clis/zhihu/answer-detail.test.js clis/zhihu/answer-comments.test.js
  • npm run check:typed-error-lint
  • npm run check:silent-column-drop
  • git diff --check
  • npm run dev -- zhihu search "Claude Code vs Codex?" --limit 5 -f json

@jackwener jackwener force-pushed the fix/zhihu-text-entities branch from 5aa2764 to e71df8a Compare May 25, 2026 06:56
@jackwener jackwener merged commit 7362ced into jackwener:main May 25, 2026
11 checks passed
@lenovobenben lenovobenben deleted the fix/zhihu-text-entities branch July 2, 2026 10:59
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.

2 participants