Skip to content

feat(mdx): add opt-out CJK-friendly emphasis remark plugin and markdown.cjkFriendlyEmphasis#3201

Merged
SoonIter merged 2 commits intoweb-infra-dev:mainfrom
tats-u:cjk-friendly-emphasis
Mar 9, 2026
Merged

feat(mdx): add opt-out CJK-friendly emphasis remark plugin and markdown.cjkFriendlyEmphasis#3201
SoonIter merged 2 commits intoweb-infra-dev:mainfrom
tats-u:cjk-friendly-emphasis

Conversation

@tats-u
Copy link
Copy Markdown
Contributor

@tats-u tats-u commented Mar 7, 2026

Summary

Adds built-in CJK-friendly emphasis/strikethrough support to Rspress using remark-cjk-friendly and remark-cjk-friendly-gfm-strikethrough.

See also:

Related Issue

Fixes #2772

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Tatsunori Uchino <tats.u@live.jp>
Copilot AI review requested due to automatic review settings March 7, 2026 08:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds first-party CJK-friendly emphasis/strikethrough parsing to the MDX pipeline (opt-out via markdown.cjkFriendlyEmphasis) by wiring in remark-cjk-friendly and its GFM strikethrough companion, along with docs and tests.

Changes:

  • Add markdown.cjkFriendlyEmphasis config option (default true) to enable/disable CJK-friendly emphasis + strikethrough parsing.
  • Register remark-cjk-friendly and remark-cjk-friendly-gfm-strikethrough in the core MDX remark plugin chain (behind the new flag).
  • Add docs (EN/ZH) and a new unit test for default/enabled/disabled behavior; update dependencies/lockfile.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/docs/zh/api/config/config-build.mdx Documents markdown.cjkFriendlyEmphasis option in Chinese, including disable example.
website/docs/en/api/config/config-build.mdx Documents markdown.cjkFriendlyEmphasis option in English, including disable example.
packages/shared/src/types/index.ts Adds cjkFriendlyEmphasis?: boolean to MarkdownOptions with JSDoc.
packages/core/src/node/mdx/options.ts Enables CJK-friendly remark plugins by default and gates them via config flag.
packages/core/src/node/mdx/cjkFriendlyEmphasis.test.ts Adds coverage for default/on/off emphasis parsing and default strikethrough parsing.
packages/core/package.json Adds the two new remark dependencies to core.
pnpm-lock.yaml Locks new dependencies and their micromark extensions.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/shared/src/types/index.ts Outdated
Comment thread packages/core/src/node/mdx/cjkFriendlyEmphasis.test.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SoonIter SoonIter changed the title feat(core): add opt-out CJK-friendly emphasis extension feat(mdx): add opt-out CJK-friendly emphasis extension Mar 9, 2026
@SoonIter SoonIter changed the title feat(mdx): add opt-out CJK-friendly emphasis extension feat(mdx): add opt-out CJK-friendly emphasis remark plugin and markdown.cjkFriendlyEmphasis Mar 9, 2026
Copy link
Copy Markdown
Member

@SoonIter SoonIter left a comment

Choose a reason for hiding this comment

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

LGTM! thanks ❤

@SoonIter SoonIter merged commit 3e8aa80 into web-infra-dev:main Mar 9, 2026
6 checks passed
@tats-u tats-u deleted the cjk-friendly-emphasis branch March 9, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Consider supporting CJK Friendly emphasis extension (remark-cjk-friendly) instead of plain CommonMark/GFM emphasis

4 participants