Skip to content

fix(web): parse bold text around CJK punctuation - #9183

Closed
orbitingflea wants to merge 1 commit into
pingdotgg:mainfrom
orbitingflea:fix/cjk-bold-emphasis
Closed

orbitingflea wants to merge 1 commit into
pingdotgg:mainfrom
orbitingflea:fix/cjk-bold-emphasis

Conversation

@orbitingflea

@orbitingflea orbitingflea commented Sep 2, 2026 •

Copy link
Copy Markdown

Bold text that ends in a CJK character or full-width punctuation, such as
**粗体。**, renders as literal asterisks in chat markdown. CommonMark's
emphasis rules treat the closing ** after 。 as not right-flanking, so
the 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:
before

After:
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-friendly to the web app and wires remarkCjkFriendly into both ChatMarkdown remark plugin lists (default and lineBreaks), 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 without lineBreaks.

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 ChatMarkdown

  • Adds remark-cjk-friendly to both remark plugin pipelines in ChatMarkdown.tsx, placed before remarkBreaks in the line-break pipeline.
  • New parameterized test in ChatMarkdown.test.tsx verifies bold text ending in CJK punctuation renders as <strong> without leftover ** markers, for both lineBreaks settings.

Macroscope summarized 59bf767.

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]>
Copilot AI lite review requested due to automatic review settings September 2, 2026 07:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-02T07:28:56.670585Z 59bf767 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@macroscopeapp

macroscopeapp Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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:

  • Diff unchanged. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@orbitingflea orbitingflea reopened this Sep 29, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Sep 30, 2026 — with ChatGPT Codex Connector
@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Hi! We are cleaning up open PRs, and this one appears to have been created with an older model (fable 5). If this change is really important, we recommend rebuilding the PR with a newer model if possible.

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

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants