feat(mdx): add opt-out CJK-friendly emphasis remark plugin and markdown.cjkFriendlyEmphasis#3201
Merged
SoonIter merged 2 commits intoweb-infra-dev:mainfrom Mar 9, 2026
Merged
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Tatsunori Uchino <tats.u@live.jp>
Contributor
There was a problem hiding this comment.
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.cjkFriendlyEmphasisconfig option (defaulttrue) to enable/disable CJK-friendly emphasis + strikethrough parsing. - Register
remark-cjk-friendlyandremark-cjk-friendly-gfm-strikethroughin 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
markdown.cjkFriendlyEmphasis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds built-in CJK-friendly emphasis/strikethrough support to Rspress using
remark-cjk-friendlyandremark-cjk-friendly-gfm-strikethrough.See also:
Related Issue
Fixes #2772
Checklist