惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
WordPress大学
WordPress大学
V
V2EX
Jina AI
Jina AI
S
Schneier on Security
Cyberwarzone
Cyberwarzone
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
PCI Perspectives
PCI Perspectives
美团技术团队
小众软件
小众软件
L
LangChain Blog
N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
T
Threatpost
T
Tor Project blog
K
Kaspersky official blog
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
H
Heimdal Security Blog
N
News and Events Feed by Topic
T
Threat Research - Cisco Blogs
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
M
MIT News - Artificial intelligence
Apple Machine Learning Research
Apple Machine Learning Research
N
News | PayPal Newsroom
I
Intezer
博客园 - 聂微东
U
Unit 42
Cisco Talos Blog
Cisco Talos Blog
量子位
T
The Exploit Database - CXSecurity.com
Last Week in AI
Last Week in AI
博客园_首页
月光博客
月光博客
Webroot Blog
Webroot Blog
I
InfoQ
The Cloudflare Blog
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
Project Zero
Project Zero
Hacker News: Ask HN
Hacker News: Ask HN
IT之家
IT之家
Google DeepMind News
Google DeepMind News
C
Cisco Blogs

Streamdown Documentation

Configuration FAQ Getting Started Introduction Security Animation Carets Code Blocks Components GitHub Flavored Markdown Interactivity Internationalization Link Safety Memoization Migrate from react-markdown Styling Unterminated Block Parsing Typography Usage @streamdown/code Built-in Plugins @streamdown/math @streamdown/mermaid Custom renderers
@streamdown/cjk
Vercel · 2026-04-11 · via Streamdown Documentation

Improved handling of Chinese, Japanese, and Korean text.

The @streamdown/cjk plugin improves handling of CJK (Chinese, Japanese, Korean) text with proper emphasis formatting and autolink handling. This is particularly important for AI-generated content, where language models naturally place emphasis markers around phrases that include or end with punctuation.

  • Correct emphasis formatting near ideographic punctuation (bold, italic, strikethrough)
  • Splits autolinks at CJK punctuation boundaries to prevent URLs from swallowing trailing punctuation
  • Uses remark-cjk-friendly and remark-cjk-friendly-gfm-strikethrough for proper parsing

Tailwind v4

Add the following @source directive to your globals.css or main CSS file:

@source "../node_modules/@streamdown/cjk/dist/*.js";

The path must be relative from your CSS file to the node_modules folder containing @streamdown/cjk. In a monorepo, adjust the number of ../ segments to reach the root node_modules.

Tailwind v3

Add @streamdown/cjk to your content array in tailwind.config.js:

module.exports = {
  content: [
    "./app/**/*.{js,ts,jsx,tsx,mdx}",
    "./node_modules/@streamdown/cjk/dist/*.js",
  ],
  // ... rest of your config
};

In a monorepo, adjust the path to reach the root node_modules:

module.exports = {
  content: [
    "./app/**/*.{js,ts,jsx,tsx,mdx}",
    "../../node_modules/@streamdown/cjk/dist/*.js",
  ],
  // ... rest of your config
};
import { cjk } from '@streamdown/cjk';

<Streamdown plugins={{ cjk }}>
  {markdown}
</Streamdown>

For advanced configuration, use createCjkPlugin:

import { Streamdown } from "streamdown";
import { createCjkPlugin } from "@streamdown/cjk";

const cjk = createCjkPlugin();

export default function Page() {
  return (
    <Streamdown plugins={{ cjk }}>
      {markdown}
    </Streamdown>
  );
}

The CommonMark/GFM specification has a limitation where emphasis markers (** or *) adjacent to ideographic punctuation marks occasionally fail to be recognized. This causes formatting to break in CJK text:

**この文は太字になりません(This won't be bolded)。**この文のせいで(It is due to this sentence)。

Without CJK-friendly parsing, the text above would render as plain text instead of bold because the closing ** appears next to the Japanese period.

Bold Text with Punctuation

Works correctly with all ideographic punctuation marks:

**日本語の文章(括弧付き)。**この文が後に続いても大丈夫です。
**中文文本(带括号)。**这句子继续也没问题。
**한국어 구문(괄호 포함)**을 강조.

Japanese: 日本語の文章(括弧付き)。この文が後に続いても大丈夫です。

Chinese: 中文文本(带括号)。这句子继续也没问题。

Korean: 한국어 구문(괄호 포함)을 강조.

Italic Text with Punctuation

*これは斜体のテキストです(括弧付き)。*この文が後に続いても大丈夫です。
*这是斜体文字(带括号)。*这句子继续也没问题。
*이 텍스트(괄호 포함)*는 기울임꼴입니다.

Japanese: これは斜体のテキストです(括弧付き)。この文が後に続いても大丈夫です。

Chinese: 这是斜体文字(带括号)。这句子继续也没问题。

Korean: 이 텍스트(괄호 포함)는 기울임꼴입니다.

Strikethrough with Punctuation

Streamdown includes remark-cjk-friendly-gfm-strikethrough for proper strikethrough support:

~~削除されたテキスト(括弧付き)。~~この文は正しいです。
~~删除的文字(带括号)。~~这个句子是正确的。
~~이 텍스트(괄호 포함)~~를 삭제합니다.

Japanese: 削除されたテキスト(括弧付き)。この文は正しいです。

Chinese: 删除的文字(带括号)。这个句子是正确的。

Korean: 이 텍스트(괄호 포함)를 삭제합니다。

Mixed Content

CJK and English text work seamlessly together:

**重要提示(Important Notice):**请注意。

Result: 重要提示(Important Notice):请注意。

The plugin handles all common ideographic punctuation marks:

  • Parentheses: ()
  • Brackets: 【】「」〈〉
  • Periods: 。.
  • Commas: ,、
  • Questions:
  • Exclamations:
  • Colons:

Language models generate markdown naturally, often placing emphasis markers around phrases that include punctuation. Without CJK-friendly parsing, AI-generated content in Chinese, Japanese, or Korean would have broken formatting.

❌ Without CJK support:
  • The model writes: **この用語(読み方など)**について説明します。- The user sees: **この用語(読み方など)**について説明します。 (not bold!)
✅ With CJK support:
  • The model writes: **この用語(読み方など)**について説明します。- The user sees: この用語(読み方など)について説明します。 (properly bolded!)

The CJK plugin also prevents autolinks from swallowing trailing CJK punctuation. When a URL ends with CJK punctuation characters, the plugin splits the link so the punctuation appears as regular text.

Example:

Check out https://example.com。这是一个链接。

Without CJK support, the trailing would be included in the URL. With the plugin, the link ends at https://example.com and the period is rendered as text.

Supported boundary characters:

。.,、?!:;()【】「」『』〈〉《》

The CJK plugin provides remark plugins in a specific order for proper integration:

interface CjkPlugin {
  // Plugins that run BEFORE remarkGfm (e.g., remark-cjk-friendly)
  remarkPluginsBefore: Pluggable[];

  // Plugins that run AFTER remarkGfm (e.g., autolink boundary, strikethrough)
  remarkPluginsAfter: Pluggable[];

  // @deprecated - Use remarkPluginsBefore and remarkPluginsAfter instead
  remarkPlugins: Pluggable[];
}

Streamdown automatically handles the plugin ordering. If integrating manually, ensure:

  1. remarkPluginsBefore runs before remarkGfm (modifies emphasis handling)
  2. remarkPluginsAfter runs after remarkGfm (enhances autolinks and strikethrough)