Repository navigation
fix(web): parse bold text around CJK punctuation - #9183
orbitingflea wants to merge 1 commit into
Conversation
CommonMark emphasis like **粗体。** fails to close after CJK punctuation, so bold text ending in a CJK character or full-width punctuation renders as literal asterisks in chat markdown. Add remark-cjk-friendly to both chat markdown remark plugin chains so emphasis closes correctly in that case. Co-Authored-By: Claude Fable 5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59bf76752a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| remarkGithubAlerts, | ||
| remarkNormalizeListItemIndentation, | ||
| remarkCodexDirectives, | ||
| remarkCjkFriendly, |
There was a problem hiding this comment.
Apply the CJK emphasis fix to mobile
For messages containing this pattern, the fix remains limited to the web/desktop renderer: AssistantMarkdownContent in apps/mobile/src/features/threads/ThreadFeed.tsx:898-915 still passes the unchanged Markdown to the native and fallback mobile renderers, and the bundled MD4C parser treats **都没修。**Fetch as one literal text node. Mobile users therefore continue to see the asterisks even though chat behavior should be consistent across clients; add equivalent preprocessing/parser support and a focused mobile test.
AGENTS.md reference: AGENTS.md:L67-L70
Useful? React with 👍 / 👎.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The web Markdown fix is localized and tested, but an unresolved concrete finding shows that mobile users still receive literal CJK emphasis markers through a separate renderer. The incomplete cross-client behavior warrants human review. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Note Written by Hi! We are cleaning up open PRs, and this one appears to have been created with an older model ( |
Bold text that ends in a CJK character or full-width punctuation, such as
**粗体。**, renders as literal asterisks in chat markdown. CommonMark'semphasis rules treat the closing
**after。as not right-flanking, sothe emphasis never closes.
Add remark-cjk-friendly to the chat markdown remark plugin list in
ChatMarkdown.tsx, in both the default list and the lineBreaks variant. It
relaxes the flanking rules for CJK text so emphasis closes correctly, and
leaves non-CJK markdown unchanged.
Scope: web client only. The mobile app uses a separate markdown renderer
and is not covered here.
Before:

After:

Model: Claude Fable 5 · Harness: Claude Code
Note
Low Risk
Localized markdown parsing change in the web chat renderer with regression tests; no auth, data, or API surface changes.
Overview
Fixes chat markdown where bold ending in CJK or full-width punctuation (e.g.
**都没修。**) showed literal asterisks instead of<strong>.Adds
remark-cjk-friendlyto the web app and wiresremarkCjkFriendlyinto bothChatMarkdownremark plugin lists (default andlineBreaks), so emphasis flanking rules treat CJK text correctly without changing typical Latin markdown.Adds unit tests that assert bold-with-CJK-punctuation renders as
<strong>with and withoutlineBreaks.Reviewed by Cursor Bugbot for commit 59bf767. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix bold text parsing around CJK punctuation in
ChatMarkdownremark-cjk-friendlyto both remark plugin pipelines in ChatMarkdown.tsx, placed beforeremarkBreaksin the line-break pipeline.<strong>without leftover**markers, for bothlineBreakssettings.Macroscope summarized 59bf767.