This package has been deprecated

Author message:

Superseded by markdown-it-cjk-friendly. Switch to it. This package may be unpublished in the future.

markdown-it-cj-friendly
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

markdown-it-cj-friendly

Version

A markdown-it plugin to make Markdown emphasis (**) in CommonMark compatible with Chinese and Japanese.

CommonMarkの強調記号(**)を中国語・日本語にきちんと対応させるためのmarkdown-itプラグイン

一个 markdown-it 插件,用于使 CommonMark 的强调标记(**)能够正确支持中文和日语文本。

Problem / 問題 / 问题

CommonMark has a problem that the following emphasis marks ** are not recognized as emphasis marks in Japanese and Chinese.

CommonMarkには、日本語・中国語内の次のような強調記号(**)が強調記号として認識されない問題があります。

CommonMark存在以下问题:在中文和日语文本中,强调标记**不会被识别为强调标记。

**このアスタリスクは強調記号として認識されず、そのまま表示されます。**この文のせいで。

**该星号不会被识别,而是直接显示。**这是因为它没有被识别为强调符号。

This problem occurs because the character just inside the ** is a (Japanese or Chinese) punctuation mark (。) and the character just outside is not a space or punctuation mark.

これが起こった原因は、終了側の**のすぐ内側が約物(。)、かつ外側が約物や空白以外の文字であるためです。

这个问题是因为在**的结束部分,内侧字符是中文或日文的标点符号(。),而外侧字符不是空格或标点符号。

Of course, not only the end side but also the start side has the same issue.

もちろん終了側だけでなく、開始側も同様の問題が存在します。

当然,不仅是结束侧,开始侧也存在同样的问题。

Installation / インストール / 安装

Install markdown-it-cj-friendly via npm:

markdown-it-cj-friendlynpmでインストールしてください。

通过 npm 安装 markdown-it-cj-friendly

npm install markdown-it-cj-friendly

If you use another package manager, please replace npm with the command of the package manager you use (e.g. pnpm).

npm以外のパッケージマネージャを使う場合は、npmを当該パッケージマネージャのコマンド(例:pnpm)に置き換えてください。

如果使用其他包管理器,请将 npm 替换为当时包管理器的命令(例如:pnpm)。

Usage / 使い方 / 用法

Import markdown-it and markdown-it-cj-friendly, and use the plugin as follows:

markdown-itmarkdown-it-cj-friendlyをインポートし、次のようにプラグインを使用してください。

通过 markdown-itmarkdown-it-cj-friendly 导入,然后使用插件如下:

import MarkdownIt from "markdown-it";
import markdownItCjFriendly from "markdown-it-cj-friendly";

const md = MarkdownIt();
md.use(markdownItCjFriendly);

Contributing / 貢献 / 贡献

Setup

Install the dependencies:

pnpm install

Get Started

Build the library:

pnpm build

Build the library in watch mode:

pnpm dev

Package Sidebar

Install

npm i markdown-it-cj-friendly

Weekly Downloads

6

Version

0.1.1

License

MIT

Unpacked Size

14.7 kB

Total Files

6

Last publish

Collaborators

  • tats-u