• English
  • CJK support

    CjkPlugin improves Markdown parsing for Chinese, Japanese, and Korean text. It recognizes emphasis, strong emphasis, and strikethrough next to CJK punctuation, and keeps that punctuation out of bare URLs. The Full components for React, Vue, Svelte, Angular, React Native, Lynx, Solid, and Taro include it by default; Lite components can add it as needed.

    import { Fluxdown } from 'fluxdown';
    
    export function Message() {
      return <Fluxdown text="这是**加粗。**文字。" />;
    }

    The text 加粗。 is bold, without requiring spaces around the delimiters.

    Supported content

    Markdown delimiters can appear next to CJK punctuation:

    这是**加粗。**文字。
    これは*強調。*です。
    이것은~~삭제。~~입니다.

    Bare URLs end before 。.,、?!:;()【】「」『』〈〉《》. For example, https://example.com。 links to https://example.com, leaving the final 。 as ordinary text.

    Explicit Markdown links and code preserve their content. The URL in [link](https://example.com/路径。) stays unchanged, as does punctuation inside inline code and fenced code blocks.

    Import the plugin

    All Full components include CjkPlugin without manual registration. For Core or a Lite component, install the matching plugin package:

    pnpm add @fluxdown/core-plugins

    For Core, add CjkRemarkPlugin to the remarks input in the quick start. Components extend their presets through plugins:

    import { CjkRemarkPlugin } from '@fluxdown/core-plugins/plugins/remark/cjk';
    
    const remarks = [CjkRemarkPlugin];

    Disable CJK support

    Include CjkPlugin and config in the same plugin pack to disable this behavior. Core uses a remark plugin entry with disabled set:

    import type { IPluggable, IRemarkPlugin } from '@fluxdown/types';
    
    import { CjkRemarkPlugin } from '@fluxdown/core-plugins/plugins/remark/cjk';
    
    const remarks: IPluggable<IRemarkPlugin, unknown>[] = [
      [CjkRemarkPlugin, { disabled: true }],
    ];