Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

markdown-it-cj-friendly

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-it-cj-friendly

markdown-it plugin to make Markdown emphasis (`**`) in CommonMark more friendly with Chinese and Japanese

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

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

Keywords

markdown-it-plugin

FAQs

Package last updated on 13 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts