Skip to content

fix(renderer-image): support bold markdown beside CJK text#980

Merged
dingyi222666 merged 2 commits into
v1-devfrom
fix/image-renderer-markdown-bold
Jul 19, 2026
Merged

fix(renderer-image): support bold markdown beside CJK text#980
dingyi222666 merged 2 commits into
v1-devfrom
fix/image-renderer-markdown-bold

Conversation

@dingyi222666

Copy link
Copy Markdown
Member

This pr fixes bold markdown rendering for image replies, including bold text beside CJK characters.

Closes #979

New Features

  • None

Bug Fixes

  • Add a relaxed marked strong tokenizer so **bold** works next to CJK text in image and mixed-image renderers

Other Changes

  • None

Validation

  • yarn lint-fix (0 errors, 2 existing warnings)

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • packages/renderer-image/package.json is excluded by !**/*.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3be9f731-665c-47ea-94f3-06c589c6daf8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

新增宽松的 Markdown 加粗解析器,处理 **...** 及相邻星号场景,并接入图片与混合图片渲染器的 Marked 配置。

Changes

Markdown 加粗渲染

Layer / File(s) Summary
宽松加粗 tokenizer
packages/renderer-image/src/utils.ts
新增 relaxedStrong 扩展,自定义 strong tokenizer 解析加粗文本并处理相邻星号模式。
渲染器插件接入
packages/renderer-image/src/renders/image.ts, packages/renderer-image/src/renders/mixed-image.ts
relaxedStrong 加入两种图片渲染器的 Marked 插件配置。

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

我是兔子蹦蹦跳,
星星加粗不再绕。
**TEST** 清清楚,
中文相邻也稳住。
Marked 插件排好队,
图片渲染亮晶晶!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确概括了本次修改的核心:修复图片渲染中 CJK 邻近加粗 Markdown 的解析问题。
Description check ✅ Passed 描述清楚说明了这次修复的目标和实现方式,与变更内容一致。
Linked Issues check ✅ Passed 代码新增 relaxedStrong 并接入两个图片渲染器,直接对应 #979 的图片回复加粗渲染错误。
Out of Scope Changes check ✅ Passed 所有改动都围绕 markdown 加粗解析修复展开,未见明显无关改动。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/image-renderer-markdown-bold

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a new relaxedStrong Marked extension in packages/renderer-image/src/utils.ts to support LLM-style bold text formatting beside CJK characters, and integrates it into both image.ts and mixed-image.ts renderers. A review comment points out a potential issue with the regular expression in relaxedStrong which can cause runaway matching across multiple bold blocks if one is malformed, and provides a code suggestion to prevent crossing intermediate ** delimiters.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/renderer-image/src/utils.ts
@dingyi222666
dingyi222666 merged commit 2b4ce4c into v1-dev Jul 19, 2026
3 checks passed
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.

MD语法渲染错误

1 participant