TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/vercel/streamdown/llms.txt
Use this file to discover all available pages before exploring further.
@streamdown/cjk plugin fixes two categories of parsing problems that arise with Chinese, Japanese, and Korean (CJK) text in CommonMark/GFM:
- Emphasis near ideographic punctuation — bold, italic, and strikethrough markers adjacent to characters like
()。,fail to be recognized by default parsers. - Autolink boundary bleeding — URLs followed by CJK punctuation cause the punctuation to be swallowed into the URL.
Installation
What the plugin fixes
Emphasis near ideographic punctuation
The CommonMark specification has a known limitation where emphasis markers are not recognized when adjacent to ideographic punctuation. Without the CJK plugin:** appears next to ).
With @streamdown/cjk, bold, italic, and GFM strikethrough all work correctly next to any ideographic punctuation in Japanese, Chinese, and Korean.
Autolink boundary splitting
When GFM autolinks are followed by CJK punctuation, the plugin splits the link at the boundary so the punctuation is rendered as text:。 is included in the URL. With the plugin, the link stops at https://example.com and the period renders as text.
Recognized boundary characters:
。.,、?!:;()【】「」『』〈〉《》
Plugin architecture
The CJK plugin provides remark plugins split into two groups based on where they must run relative toremark-gfm:
remarkPluginsBefore→remark-cjk-friendlyremark-gfm(default)remarkPluginsAfter→ autolink boundary splitter,remark-cjk-friendly-gfm-strikethrough
API reference
createCjkPlugin()
Creates a CjkPlugin instance. The function takes no options:
Pre-configured instance
@streamdown/cjk exports a pre-configured instance:
When to use this plugin
Add@streamdown/cjk when:
- Your application renders AI-generated content in Chinese, Japanese, or Korean.
- Users can write markdown in CJK languages.
- You display content from sources that mix CJK text with emphasis markers or URLs.
