Skip to content

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

Open
lenovobenben wants to merge 1 commit into
jackwener:mainfrom
lenovobenben:fix/zhihu-text-entities
Open

fix(zhihu): decode numeric entities in text output#1695
lenovobenben wants to merge 1 commit 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

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