An utility library package for micromark-extension-cjk-friendly, which is internally used by remark-cjk-friendly, and its related packages.
CommonMark has a problem that the following emphasis marks **
are not recognized as emphasis marks in Japanese, Chinese, and Korean.
CommonMarkには、日本語・中国語・韓国語内の次のような強調記号(**
)が強調記号として認識されない問題があります。
CommonMark存在以下问题:在中文、日语和韩语文本中,强调标记**
不会被识别为强调标记。
CommonMark는 일본어와 중국어에서 다음과 같은 강조 표시 **
가 강조 표시로 인식되지 않는 문제가 있습니다.
**このアスタリスクは強調記号として認識されず、そのまま表示されます。**この文のせいで。
**该星号不会被识别,而是直接显示。**这是因为它没有被识别为强调符号。
**이 별표는 강조 표시로 인식되지 않고 그대로 표시됩니다(이 괄호 때문에)**이 문장 때문에.
This problem occurs because the character just inside the **
is a (Japanese or Chinese) punctuation mark (。) or parenthesis 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.
もちろん終了側だけでなく、開始側も同様の問題が存在します。
当然,不仅是结束侧,开始侧也存在同样的问题。
물론 끝나는 부분뿐만 아니라 시작하는 부분에서도 동일한 문제가 있습니다.
CommonMark issue: https://github.com/commonmark/commonmark-spec/issues/650
This package is ESM-only. It requires Node.js 16 or later.
本パッケージはESM専用です。Node.js 16以上が必要です。
此包仅支持ESM。需要Node.js 16或更高版本。
이 패키지는 ESM만 사용을 위한 패키지입니다. Node.js 16或更高版本가 필요입니다.
This package uses the v
flag for regular expressions introduced in ES2024, if available, to determine whether a character is an emoji. In the following compatible environments, it will comply with the Unicode version supported by the runtime. Otherwise, it will fall back to the snapshot as of Unicode 16.
本パッケージは文字が絵文字かどうかを判定するために、ES2024で導入された正規表現のv
フラグが利用可能であれば使用します。以下の対応環境の場合、ランタイムが対応しているUnicodeバージョンに準拠します。それ以外の場合、Unicode 16時点のスナップショットにフォールバックします。
本包使用ES2024引入的正则表达式v
标志(如果可用)来判断字符是否为表情符号。在以下兼容环境中,将遵循运行时支持的Unicode版本。否则,将回退到Unicode 16的快照。
이 패키지는 문자가 이모지인지 판단하기 위해 ES2024에서 도입된 정규표현식 v
플래그를 사용할 수 있다면 사용합니다. 다음 호환 환경에서는 런타임이 지원하는 Unicode 버전을 따릅니다. 그렇지 않은 경우, Unicode 16 시점의 스냅샷으로 폴백합니다.
- Chrome / Edge 112 or later
- Firefox 116 or later
- Safari 17 or later
- Node.js 20 or later
Install micromark-extension-cjk-friendly-util
via npm:
micromark-extension-cjk-friendly-util
をnpmでインストールしてください。
通过 npm 安装 micromark-extension-cjk-friendly-util
。
micromark-extension-cjk-friendly-util
를 npm으로 설치하세요.
npm install micromark-extension-cjk-friendly-util
If you use another package manager, please replace npm install
with the command of the package manager you use (e.g. pnpm add
or yarn add
).
npm以外のパッケージマネージャを使う場合は、npm install
を当該パッケージマネージャのコマンド(例:pnpm add
・yarn add
)に置き換えてください。
如果使用其他包管理器,请将 npm install
替换为当时包管理器的命令(例如:pnpm add
、yarn add
)。
다른 패키지 매니저를 사용하는 경우 npm install
을 해당 패키지 매니저의 명령어(예: pnpm add
, yarn add
)로 바꾸어 주세요.
[!IMPORTANT] Most people do not have to use this package directly. Did you mean:
This package provides a function and a namespace based on the original micromark-related packages:
Name | Type | Derived from | Original Name | Description |
---|---|---|---|---|
classifyCharacter |
function | micromark-util-character | (same) | Tells whether a character is not only a punctuation or whitespace but also a CJK or variation selector |
constantsEx |
namespace | micromark-util-symbol | constants |
Constants meaning CJK and variation selectors; use it and the original constants together. |
Also, this package provides some utility functions to check whether a character belongs to the category defined in the specification (e.g. CJK character), or to help you fetch the Unicode Code Point of a character around the emphasis mark.
https://github.com/tats-u/markdown-cjk-friendly/blob/main/specification.md (English)
-
micromark-extension-cjk-friendly
-
remark-cjk-friendly
-
markdown-it-cjk-friendly
-
remark-cjk-friendly
-
micromark-extension-cjk-friendly-gfm-strikethrough
Install the dependencies:
pnpm install
Build the library:
pnpm build
Build the library in watch mode:
pnpm dev