### Setup Project Dependencies Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/markdown-it-cj-friendly/README.md Install project dependencies using pnpm. This is part of the contributing setup. ```bash pnpm install ``` -------------------------------- ### Install micromark-extension-cjk-friendly-gfm-strikethrough Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/micromark-extension-cjk-friendly-gfm-strikethrough/README.md Install the package using npm. If you use a different package manager, replace `npm install` with the appropriate command. ```bash npm install micromark-extension-cjk-friendly-gfm-strikethrough ``` -------------------------------- ### Install micromark-extension-cjk-friendly with npm Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/micromark-extension-cjk-friendly/README.md Install the package using npm. If you use a different package manager, replace `npm install` with the appropriate command. ```bash npm install micromark-extension-cjk-friendly ``` -------------------------------- ### Start Local Development Server Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/docusaurus/README.md Starts a local development server for live preview. Changes are reflected without restarting. ```bash $ yarn start ``` -------------------------------- ### Install Dependencies with npm Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/rspress/README.md Run this command to install all necessary project dependencies. ```bash npm install ``` -------------------------------- ### Install micromark-extension-cjk-friendly-util with npm Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/micromark-extension-cjk-friendly-util/README.md Install the utility package using npm. If you use a different package manager, replace 'npm install' with the appropriate command. ```bash npm install micromark-extension-cjk-friendly-util ``` -------------------------------- ### Install markdown-it-cjk-friendly with npm Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/markdown-it-cjk-friendly/README.md Use this command to install the package using npm. If you use a different package manager, replace `npm install` with the appropriate command. ```bash npm install markdown-it-cjk-friendly ``` -------------------------------- ### Install marked-cjk-friendly via npm Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/marked-cjk-friendly/README.md Install the marked-cjk-friendly package using npm. Replace `npm install` with your package manager's command if necessary. ```bash npm install marked-cjk-friendly ``` -------------------------------- ### Astro Project Commands Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/astro/README.md Common commands for managing an Astro project. These include installing dependencies, starting the development server, building for production, and previewing the build. ```sh pnpm install ``` ```sh pnpm dev ``` ```sh pnpm build ``` ```sh pnpm preview ``` ```sh pnpm astro ... ``` ```sh pnpm astro -- --help ``` -------------------------------- ### Start Rspress Development Server Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/rspress/README.md Use this command to launch the local development server and see your changes in real-time. ```bash npm run dev ``` -------------------------------- ### Install remark-cjk-friendly via npm Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/remark-cjk-friendly-gfm-strikethrough/README.md Install the remark-cjk-friendly package using npm. If you use a different package manager, replace `npm install` with the appropriate command. ```bash npm install remark-cjk-friendly ``` -------------------------------- ### Build and Test Commands for PNPM Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/README.md Commands to install dependencies, build all packages, and run tests using PNPM. ```bash pnpm i node --run build ``` ```bash node --run test ``` -------------------------------- ### Install markdown-it-cj-friendly via npm Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/markdown-it-cj-friendly/README.md Install the markdown-it-cj-friendly package using npm. Replace `npm` with your package manager's command if necessary. ```bash npm install markdown-it-cj-friendly ``` -------------------------------- ### Install Docusaurus Dependencies Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/docusaurus/README.md Run this command to install project dependencies using Yarn. ```bash $ yarn ``` -------------------------------- ### Import and Use CJK Friendly Extension with Micromark Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/micromark-extension-cjk-friendly/README.md Import the necessary micromark and extension modules. Use the `cjkFriendlyExtension` within the `extensions` array when initializing micromark. This example also shows combining it with the GFM extension. ```javascript import { micromark } from "micromark"; import { gfm, gfmHtml } from "micromark-extension-gfm"; import { cjkFriendlyExtension } from "micromark-extension-cjk-friendly"; // e.g. combine with GFM extension const htmlString = micromark( markdownString, { extensions: [gfm(), cjkFriendlyExtension()], // in no particular order htmlExtensions: [gfmHtml()], } ) ``` -------------------------------- ### Usage with remark processor Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/remark-cjk-friendly/README.md Import and use remark-cjk-friendly within a remark processor pipeline. This example demonstrates integration with remarkParse, remarkGfm, remarkRehype, and rehypeStringify for HTML output. ```javascript import rehypeStringify from "rehype-stringify"; import remarkCjkFriendly from "remark-cjk-friendly"; import remarkGfm from "remark-gfm"; import remarkParse from "remark-parse"; import remarkRehype from "remark-rehype"; import { unified } from "unified"; // e.g. in the case that you want to enable GFM and obtain HTML output const processor = unified() .use(remarkParse) .use(remarkGfm) .use(remarkCjkFriendly) .use(remarkRehype) .use(rehypeStringify); const htmlResult = (await processor.process(markdownString)).toString(); ``` -------------------------------- ### Use remark-cjk-friendly Plugin Source: https://context7.com/tats-u/markdown-cjk-friendly/llms.txt Incorporate this unified/remark plugin into your pipeline to fix emphasis and strong emphasis for CJK text. Ensure it's placed after remark-parse and before remark-rehype. This example also shows optional GFM support. ```javascript import rehypeStringify from "rehype-stringify"; import remarkCjkFriendly from "remark-cjk-friendly"; import remarkGfm from "remark-gfm"; import remarkParse from "remark-parse"; import remarkRehype from "remark-rehype"; import { unified } from "unified"; const processor = unified() .use(remarkParse) .use(remarkGfm) // optional GFM support .use(remarkCjkFriendly) // fixes ** and _ for CJK .use(remarkRehype) .use(rehypeStringify); const input = "**この文章。**次の文\n\n**该星号。**这句话"; const result = await processor.process(input); console.log(String(result)); // Output: //

この文章。次の文

//

该星号。这句话

// MDX config example (e.g. Astro, Next.js, Vite) const mdxConfig = { remarkPlugins: [remarkGfm, remarkCjkFriendly], }; ``` -------------------------------- ### Execute Non-Task Commands with pnpm Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/AGENTS.md Execute commands that are not defined as tasks in the project's configuration using `pnpm exec`. This ensures proper environment setup provided by pnpm. ```bash pnpm exec ``` -------------------------------- ### Markdown Example of CJK Emphasis Issue Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/marked-cjk-friendly/README.md This markdown snippet demonstrates how emphasis marks (`**`) are not recognized in CJK languages, leading to them being displayed as plain text. ```markdown **このアスタリスクは強調記号として認識されず、そのまま表示されます。**この文のせいで。 **该星号不会被识别,而是直接显示。**这是因为它没有被识别为强调符号。 **이 별표는 강조 표시로 인식되지 않고 그대로 표시됩니다(이 괄호 때문에)**이 문장 때문에. ``` -------------------------------- ### Create Astro Project with Basics Template Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/astro/README.md Use this command to create a new Astro project initialized with the Basics starter kit. This sets up a foundational project structure. ```sh pnpm create astro@latest -- --template basics ``` -------------------------------- ### Build Project Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/markdown-it-cj-friendly/README.md Build the library using pnpm. This command compiles the project code. ```bash pnpm build ``` -------------------------------- ### Deploy Website (SSH) Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/docusaurus/README.md Deploys the website using SSH. Ensure SSH is configured for your deployment target. ```bash $ USE_SSH=true yarn deploy ``` -------------------------------- ### Build Static Website Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/docusaurus/README.md Generates the static content for the website into the 'build' directory. ```bash $ yarn build ``` -------------------------------- ### Build Rspress Website for Production Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/rspress/README.md Execute this command to generate the static files for your website, optimized for deployment. ```bash npm run build ``` -------------------------------- ### Deploy Website (No SSH) Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/docusaurus/README.md Deploys the website without using SSH. Replace '' with your actual username. ```bash $ GIT_USER= yarn deploy ``` -------------------------------- ### Usage with Marked.use Method Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/marked-cjk-friendly/README.md Import Marked and marked-cjk-friendly, then use the `use` method to apply the extension for parsing CJK-friendly markdown. ```javascript import { marked } from "marked"; import markedCjkFriendly from "marked-cjk-friendly"; marked.use(markedCjkFriendly()); const html = marked("**この文は太字になりますか?**即便加入这句也可以吗?"); ``` -------------------------------- ### Classify and Check CJK Characters in TypeScript Source: https://context7.com/tats-u/markdown-cjk-friendly/llms.txt Demonstrates how to use `classifyCharacter` to get a character's category and helper functions like `isCjk` and `isNonCjkPunctuation` to check specific properties. Useful for custom character handling in East Asian text processing. ```typescript import { classifyCharacter, classifyPrecedingCharacter, constantsEx, isCjk, isCjkOrIvs, isIvs, isNonCjkPunctuation, isNonEmojiGeneralUseVS, isUnicodeWhitespace, TwoPreviousCode, tryGetGenuineNextCode, tryGetGenuinePreviousCode, } from "micromark-extension-cjk-friendly-util"; import { constants } from "micromark-util-symbol"; // classifyCharacter returns a bitmask: // constants.characterGroupWhitespace (=1) – Unicode whitespace / EOF // constants.characterGroupPunctuation (=2) – non-CJK punctuation // constantsEx.cjk (=0x1000) – CJK (non-punctuation) // constantsEx.cjkPunctuation (=0x1002) – CJK punctuation // constantsEx.ivs (=0x2000) – Ideographic Variation Selector // constantsEx.nonEmojiGeneralUseVS (=0x4000) – Non-emoji General-use VS // 0 – other (regular letter/number) const catFullStop = classifyCharacter(0x3002); // 。 IDEOGRAPHIC FULL STOP const catAsterisk = classifyCharacter(0x002a); // * const catHiragana = classifyCharacter(0x3042); // あ const catSpace = classifyCharacter(0x0020); // SPACE console.log(isCjk(catHiragana)); // true console.log(isNonCjkPunctuation(catAsterisk)); // false (* is ASCII, not Unicode punct) console.log(isUnicodeWhitespace(catSpace)); // true console.log(isCjk(catFullStop)); // false (CJK punctuation, not plain CJK) console.log(isNonCjkPunctuation(catFullStop)); // false // classifyPrecedingCharacter handles variation selectors following CJK characters // (used when the character before the emphasis delimiter is a VS): const ivsCat = classifyCharacter(0xe0100); // IVS // If the char before the delimiter is an IVS, look two chars back: // classifyPrecedingCharacter(ivsCat, getTwoPrev, ivs) => category of the base char // TwoPreviousCode lazily fetches code-point two positions back (handles surrogates) // Typically used inside a micromark tokenizer context: // const twoPrev = new TwoPreviousCode(previousCode, this.now(), this.sliceSerialize); // const twoBefore = classifyPrecedingCharacter(before, twoPrev.value.bind(twoPrev), previous); ``` -------------------------------- ### Preview Rspress Production Build Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/rspress/README.md This command allows you to preview the production-ready version of your website locally before deploying. ```bash npm run preview ``` -------------------------------- ### Usage with Marked Constructor Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/marked-cjk-friendly/README.md Import Marked and marked-cjk-friendly, then instantiate Marked with the extension to parse CJK-friendly markdown. ```javascript import { Marked } from "marked"; import markedCjkFriendly from "marked-cjk-friendly"; const marked = new Marked(markedCjkFriendly()); const html = marked.parse("**この文は太字になりますか?**即便加入这句也可以吗?"); ``` -------------------------------- ### Execute Commands with pnpx Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/AGENTS.md Use `pnpx` for executing package binaries. This is an alternative to `pnpm exec` for specific command execution scenarios. ```bash pnpx ... ``` -------------------------------- ### Build Project in Watch Mode Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/markdown-it-cj-friendly/README.md Build the library in watch mode using pnpm. This command recompiles the project automatically on file changes. ```bash pnpm dev ``` -------------------------------- ### Import and Use markdown-it CJK Friendly Plugin Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/markdown-it-cjk-friendly/README.md Import the necessary libraries and initialize the markdown-it parser with the cjk-friendly plugin. This is the standard way to integrate the plugin into your markdown processing pipeline. ```javascript import MarkdownIt from "markdown-it"; import markdownItCjkFriendly from "markdown-it-cjk-friendly"; const md = MarkdownIt(); md.use(markdownItCjkFriendly); ``` -------------------------------- ### Lint and Format Code Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/AGENTS.md Run this command to apply linting and formatting rules to the codebase using Biome. It should be executed after making changes to ensure code quality. Type checking is not included in this command. ```bash node --run fix ``` -------------------------------- ### Run Project Tasks with Node Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/AGENTS.md Use this command to execute defined tasks within the project, leveraging Node.js's built-in run script functionality. This is the preferred method for running tasks. ```bash node --run ``` -------------------------------- ### MDX Configuration for Remark Plugins Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/remark-cjk-friendly-gfm-strikethrough/README.md Configure remark-cjk-friendly-gfm-strikethrough within the remarkPlugins array for MDX. It must follow remarkGfm to function correctly. ```javascript const someMdxConfig = { remarkPlugins: [remarkGfm, remarkCjkFriendly, remarkCjkFriendlyGfmStrikethrough, ...otherRemarkPlugins], rehypePlugins: [...someRehypePlugins], }; ``` -------------------------------- ### Basic Remark Plugin Integration Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/remark-cjk-friendly-gfm-strikethrough/README.md Import and use remark-cjk-friendly-gfm-strikethrough with other remark plugins for markdown processing. Ensure it's placed between remarkGfm and remarkRehype for correct functionality. ```javascript import rehypeStringify from "rehype-stringify"; import remarkCjkFriendly from "remark-cjk-friendly"; import remarkCjkFriendlyGfmStrikethrough from "remark-cjk-friendly-gfm-strikethrough"; import remarkGfm from "remark-gfm"; import remarkParse from "remark-parse"; import remarkRehype from "remark-rehype"; import { unified } from "unified"; // e.g. in the case that you want to enable GFM and obtain HTML output const processor = unified() .use(remarkParse) .use(remarkGfm) .use(remarkCjkFriendly) .use(remarkCjkFriendlyGfmStrikethrough) .use(remarkRehype) .use(rehypeStringify); const htmlResult = (await processor.process(markdownString)).toString(); ``` -------------------------------- ### Astro Project Structure Overview Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/demos/astro/README.md This is a typical directory structure for an Astro project. Key directories include `public` for static assets and `src` for application code like layouts and pages. ```text / ├── public/ │ └── favicon.svg ├── src/ │ ├── layouts/ │ │ └── Layout.astro │ └── pages/ │ └── index.astro └── package.json ``` -------------------------------- ### Usage of markdown-it-cj-friendly Plugin Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/markdown-it-cj-friendly/README.md Import and use the markdown-it-cj-friendly plugin with markdown-it. This enables proper handling of emphasis marks in CJK languages. ```javascript import MarkdownIt from "markdown-it"; import markdownItCjFriendly from "markdown-it-cj-friendly"; const md = MarkdownIt(); md.use(markdownItCjFriendly); ``` -------------------------------- ### Usage with Micromark and GFM Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/micromark-extension-cjk-friendly-gfm-strikethrough/README.md Import and use the extension with Micromark. Ensure `gfmStrikethroughCjkFriendly()` is placed after `gfm()` in the extensions array for correct functionality. ```javascript import { micromark } from "micromark"; import { gfm, gfmHtml } from "micromark-extension-gfm"; import { cjkFriendlyExtension } from "micromark-extension-cjk-friendly"; import { gfmStrikethroughCjkFriendly } from "micromark-extension-cjk-friendly-gfm-strikethrough"; // e.g. combine with GFM extension const htmlString = micromark( markdownString, { // gfmStrikethroughCjkFriendly() must be after gfm() extensions: [gfm(), cjkFriendlyExtension(), gfmStrikethroughCjkFriendly()], htmlExtensions: [gfmHtml()] } ) ``` -------------------------------- ### General pnpm Commands Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/AGENTS.md Use general pnpm commands for package management operations other than running tasks. Avoid `pnpm run ` when `node --run ` is sufficient. ```bash pnpm ... ``` -------------------------------- ### List Supported Languages Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/ranges.md To view all programming languages supported by the `print-ranges` tool, use the `-h` option. This helps in understanding the available output formats. ```bash node --run print-ranges -- -h ``` -------------------------------- ### MDX Configuration for remark-cjk-friendly Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/packages/remark-cjk-friendly/README.md Add remarkCjkFriendly to the `remarkPlugins` array in your MDX configuration object. This ensures the plugin is applied during MDX processing. ```javascript const someMdxConfig = { remarkPlugins: [remarkGfm, remarkCjkFriendly, ...otherRemarkPlugins], rehypePlugins: [...someRehypePlugins], }; ``` -------------------------------- ### Reference Source Code for Rust Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/scripts/templates/ranges.template.md Reference source code for Rust to determine CJK character ranges. ```rust {{{ isCjk.rust }}} ``` -------------------------------- ### Generate Concrete Ranges Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/ranges.md Use this command to generate concrete ranges for Unicode terms. No specific language is selected, so it defaults to the tool's primary output. ```bash node --run print-ranges ``` -------------------------------- ### Configure remark-gfm with CJK-friendly strikethrough Source: https://context7.com/tats-u/markdown-cjk-friendly/llms.txt Use this remark plugin to ensure GFM strikethrough (`~~`) renders correctly next to CJK punctuation. It must be placed between `remark-gfm` and `remark-rehype`. The `singleTilde` option can be disabled for GitHub-compatible behavior. ```javascript import rehypeStringify from "rehype-stringify"; import remarkCjkFriendly from "remark-cjk-friendly"; import remarkCjkFriendlyGfmStrikethrough from "remark-cjk-friendly-gfm-strikethrough"; import remarkGfm from "remark-gfm"; import remarkParse from "remark-parse"; import remarkRehype from "remark-rehype"; import { unified } from "unified"; const processor = unified() .use(remarkParse) .use(remarkGfm) // must come first .use(remarkCjkFriendly) // fixes ** and _ .use(remarkCjkFriendlyGfmStrikethrough) // fixes ~~; must come after remarkGfm .use(remarkRehype) .use(rehypeStringify); const result = await processor.process("~~この文章。~~次の文"); console.log(String(result)); // Output:

この文章。次の文

// With singleTilde option disabled (double-tilde only, like GitHub): const processorStrict = unified() .use(remarkParse) .use(remarkGfm) .use(remarkCjkFriendly) .use(remarkCjkFriendlyGfmStrikethrough, { singleTilde: false }) .use(remarkRehype) .use(rehypeStringify); // MDX config const mdxConfig = { remarkPlugins: [remarkGfm, remarkCjkFriendly, remarkCjkFriendlyGfmStrikethrough], }; ``` -------------------------------- ### Reference Source Code for C/C++ Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/scripts/templates/ranges.template.md Reference source code for C (C99 or later) / C++ to determine CJK character ranges. ```c {{{ isCjk.c }}} ``` -------------------------------- ### Generate CJK Ranges (Bash) Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/scripts/templates/ranges.template.md Use this command to generate CJK ranges. Add `-l` to specify a language. ```bash node --run print-ranges ``` ```bash node --run print-ranges -- -l js ``` ```bash node --run print-ranges -- -h ``` -------------------------------- ### Use micromark extension for CJK-friendly GFM strikethrough Source: https://context7.com/tats-u/markdown-cjk-friendly/llms.txt This micromark extension provides a CJK-aware implementation for GFM strikethrough (`~~`). The `singleTilde` option (default `true`) controls whether a single `~` can also initiate strikethrough. This can be combined with the GFM extension. ```javascript import { micromark } from "micromark"; import { gfm, gfmHtml } from "micromark-extension-gfm"; import { gfmStrikethroughCjkFriendly } from "micromark-extension-cjk-friendly-gfm-strikethrough"; // Double-tilde strikethrough adjacent to CJK punctuation const html = micromark("~~この文章。~~次の文", { extensions: [gfm(), gfmStrikethroughCjkFriendly()], htmlExtensions: [gfmHtml()], }); console.log(html); //

この文章。次の文

// Disable single-tilde strikethrough (GitHub-compatible mode) const htmlStrict = micromark("~この文章。~次の文 ~~double~~", { extensions: [gfm(), gfmStrikethroughCjkFriendly({ singleTilde: false })], htmlExtensions: [gfmHtml()], }); console.log(htmlStrict); //

~この文章。~次の文 double

``` -------------------------------- ### Reference Source Code for Python Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/scripts/templates/ranges.template.md Reference source code for Python to determine CJK character ranges. ```python {{{ isCjk.py }}} ``` -------------------------------- ### Reference Source Code for C# Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/scripts/templates/ranges.template.md Reference source code for C# (C# 9 or later) to determine CJK character ranges. ```csharp {{{ isCjk.cs }}} ``` -------------------------------- ### Type Check TypeScript Files Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/AGENTS.md Execute this command to perform type checking on all TypeScript files (`.ts` and `.tsx`). This command should be run whenever changes are made to these files. ```bash node --run lint:type ``` -------------------------------- ### Reference Source Code for JavaScript Source: https://github.com/tats-u/markdown-cjk-friendly/blob/main/scripts/templates/ranges.template.md Reference source code for JavaScript to determine CJK character ranges. ```javascript {{{ isCjk.js }}} ``` -------------------------------- ### Use markdown-it-cjk-friendly Plugin Source: https://context7.com/tats-u/markdown-cjk-friendly/llms.txt Integrate this plugin into your markdown-it instance to correctly parse emphasis and strong emphasis adjacent to CJK punctuation. It patches the inline tokenizer's scanDelims method. ```javascript import MarkdownIt from "markdown-it"; import markdownItCjkFriendly from "markdown-it-cjk-friendly"; const md = new MarkdownIt(); md.use(markdownItCjkFriendly); // Without the plugin these render as literal asterisks. // With the plugin they render as . console.log(md.render("**この文章。**次の文")); // Output:

この文章。次の文

console.log(md.render("**该星号不会被识别。**这句话")); // Output:

该星号不会被识别。这句话

console.log(md.render("**이 별표。**이 문장 때문에")); // Output:

이 별표。이 문장 때문에

// Non-CJK content is completely unaffected. console.log(md.render("**hello world**")); // Output:

hello world

```