zudo-doc
GitHub repository

Type to search...

to open search from anywhere

CJK-Friendly Markdown

Created Apr 12, 2026Updated Jun 7, 2026Takeshi Takatsudo
Tags:#i18n

Fix bold/italic rendering near CJK punctuation

The Problem

Standard CommonMark has a known issue with emphasis (bold and italic) adjacent to CJK (Chinese, Japanese, Korean) punctuation. Consider this Markdown source:

**テスト。**テスト

Without the fix, this renders literally as **テスト。**テスト — the bold markers are not recognized. The same problem affects other CJK punctuation characters and also applies to italic (* and _).

Root Cause

The CommonMark spec classifies certain characters as "Unicode punctuation" for the purpose of emphasis parsing. CJK punctuation such as (ideographic period) falls into this category. The spec's flanking rules then prevent an emphasis delimiter from opening when it is directly followed by punctuation, which means the closing ** cannot match the opening **.

Affected characters include, but are not limited to:

CharacterDescription
Ideographic full stop
Ideographic comma
Right corner bracket (closing)
Fullwidth right parenthesis
White right corner bracket
Right black lenticular bracket
Right double angle bracket

Any CJK closing punctuation appearing immediately before **, *, __, or _ can trigger the issue.

How remark-cjk-friendly Fixes It

The remark-cjk-friendly plugin patches the emphasis parsing rules in micromark so that CJK punctuation is not treated as Unicode punctuation for flanking detection. This lets bold and italic work correctly when adjacent to CJK text, matching the intuitive expectation.

Before and After

Input Markdown:

**テスト。**テスト
Output
Without plugin**テスト。**テスト (rendered literally)
With pluginテスト。テスト (bold applied correctly)

The same fix applies to italic markers and all affected CJK punctuation characters.

Enabling and Disabling

The plugin is controlled by the cjkFriendly setting in src/config/settings.ts:

export const settings = {
  // ...
  cjkFriendly: true,   // set to false to disable
};

When cjkFriendly is true (the default), remark-cjk-friendly is added to the MDX remark plugin chain automatically. Set it to false if your content is English-only and you prefer the standard CommonMark behavior.

You can also configure this option when scaffolding a new project by passing a preset JSON file to the create-zudo-doc CLI with the --preset flag, or by generating one with the Setup Preset Generator. There is no dedicated --cjk-friendly / --no-cjk-friendly CLI flag — cjkFriendly is a preset/settings field only.

Revision History

Takeshi TakatsudoCreated: 2026-04-13T03:23:20+09:00Updated: 2026-06-07T16:32:08+09:00

AI Assistant

Ask a question about the documentation.