markdown-it-cjk-friendly 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +112 -0
- package/dist/index.cjs +114 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +80 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2024 Tatsunori Uchino, and authors and contributors of original packages
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
|
4
|
+
obtaining a copy of this software and associated documentation
|
|
5
|
+
files (the "Software"), to deal in the Software without
|
|
6
|
+
restriction, including without limitation the rights to use,
|
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the
|
|
9
|
+
Software is furnished to do so, subject to the following
|
|
10
|
+
conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be
|
|
13
|
+
included in all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# markdown-it-cjk-friendly
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.com/package/markdown-it-cjk-friendly)
|
|
4
|
+
|
|
5
|
+
A [markdown-it](https://github.com/markdown-it/markdown-it) plugin to make Markdown emphasis (`**`) in CommonMark compatible with Chinese, Japanese, and Korean.
|
|
6
|
+
|
|
7
|
+
<span lang="ja">CommonMarkの強調記号(`**`)を中国語・日本語・韓国語にきちんと対応させるための[markdown-it](https://github.com/markdown-it/markdown-it)プラグイン</span>
|
|
8
|
+
|
|
9
|
+
<span lang="zh-Hans-CN">一个 [markdown-it](https://github.com/markdown-it/markdown-it) 插件,用于使 CommonMark 的强调标记(`**`)能够正确支持中文、日语和韩语文本。</span>
|
|
10
|
+
|
|
11
|
+
<span lang="ko">CommonMark의 강조 표시(**) 를 중국어, 일본어, 한국어와 호환되도록 만드는 [markdown-it](https://github.com/markdown-it/markdown-it) 플러그인</span>
|
|
12
|
+
|
|
13
|
+
## Problem / <span lang="ja">問題</span> / <span lang="zh-Hans-CN">问题</span> / <span lang="ko">문제점</span>
|
|
14
|
+
|
|
15
|
+
CommonMark has a problem that the following emphasis marks `**` are not recognized as emphasis marks in Japanese and Chinese.
|
|
16
|
+
|
|
17
|
+
<span lang="ja">CommonMarkには、日本語・中国語内の次のような強調記号(`**`)が強調記号として認識されない問題があります。</span>
|
|
18
|
+
|
|
19
|
+
<span lang="zh-Hans-CN">CommonMark存在以下问题:在中文和日语文本中,强调标记**不会被识别为强调标记。</span>
|
|
20
|
+
|
|
21
|
+
<span lang="ko">CommonMark는 일본어와 중국어에서 다음과 같은 강조 표시 **가 강조 표시로 인식되지 않는 문제가 있습니다.</span>
|
|
22
|
+
|
|
23
|
+
```md
|
|
24
|
+
**このアスタリスクは強調記号として認識されず、そのまま表示されます。**この文のせいで。
|
|
25
|
+
|
|
26
|
+
**该星号不会被识别,而是直接显示。**这是因为它没有被识别为强调符号。
|
|
27
|
+
|
|
28
|
+
**이 별표는 강조 표시로 인식되지 않고 그대로 표시됩니다(이 괄호 때문에)**이 문장 때문에.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
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.
|
|
32
|
+
|
|
33
|
+
<span lang="ja">これが起こった原因は、終了側の`**`のすぐ内側が約物(。やカッコ)、かつ外側が約物や空白以外の文字であるためです。</span>
|
|
34
|
+
|
|
35
|
+
<span lang="zh-Hans-CN">这个问题是因为在`**`的结束部分,内侧字符是标点符号(。)或括号,而外侧字符不是空格或标点符号。</span>
|
|
36
|
+
|
|
37
|
+
<span lang="ko">이 문제는 `**` 바로 안쪽의 문자가 (일본어나 중국어) 문장 부호(。) 또는 괄호이고 바깥쪽 문자가 공백이나 문장 부호가 아니기 때문에 발생합니다.</span>
|
|
38
|
+
|
|
39
|
+
Of course, not only the end side but also the start side has the same issue.
|
|
40
|
+
|
|
41
|
+
<span lang="ja">もちろん終了側だけでなく、開始側も同様の問題が存在します。</span>
|
|
42
|
+
|
|
43
|
+
<span lang="zh-Hans-CN">当然,不仅是结束侧,开始侧也存在同样的问题。</span>
|
|
44
|
+
|
|
45
|
+
<span lang="ko">물론 끝나는 부분뿐만 아니라 시작하는 부분에서도 동일한 문제가 있습니다.</span>
|
|
46
|
+
|
|
47
|
+
CommonMark issue: https://github.com/commonmark/commonmark-spec/issues/650
|
|
48
|
+
|
|
49
|
+
## Installation / <span lang="ja">インストール</span> / <span lang="zh-Hans-CN">安装</span> / <span lang="ko">설치</span>
|
|
50
|
+
|
|
51
|
+
Install `markdown-it-cjk-friendly` via [npm](https://www.npmjs.com/):
|
|
52
|
+
|
|
53
|
+
<span lang="ja">`markdown-it-cjk-friendly`を[npm](https://www.npmjs.com/)でインストールしてください。</span>
|
|
54
|
+
|
|
55
|
+
<span lang="zh-Hans-CN">通过 [npm](https://www.npmjs.com/) 安装 `markdown-it-cjk-friendly`。</span>
|
|
56
|
+
|
|
57
|
+
<span lang="ko">`markdown-it-cjk-friendly`를 [npm](https://www.npmjs.com/)으로 설치하세요.</span>
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install markdown-it-cjk-friendly
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
If you use another package manager, please replace `npm` with the command of the package manager you use (e.g. `pnpm`).
|
|
65
|
+
|
|
66
|
+
<span lang="ja">npm以外のパッケージマネージャを使う場合は、`npm`を当該パッケージマネージャのコマンド(例:`pnpm`)に置き換えてください。</span>
|
|
67
|
+
|
|
68
|
+
<span lang="zh-Hans-CN">如果使用其他包管理器,请将 `npm` 替换为当时包管理器的命令(例如:`pnpm`)。</span>
|
|
69
|
+
|
|
70
|
+
<span lang="ko">다른 패키지 매니저를 사용하는 경우 `npm`을 해당 패키지 매니저의 명령어(예: `pnpm`)로 바꾸어 주세요.</span>
|
|
71
|
+
|
|
72
|
+
## Usage / <span lang="ja">使い方</span> / <span lang="zh-Hans-CN">用法</span> / <span lang="ko">사용법</span>
|
|
73
|
+
|
|
74
|
+
Import `markdown-it` and `markdown-it-cjk-friendly`, and use the plugin as follows:
|
|
75
|
+
|
|
76
|
+
<span lang="ja">`markdown-it`と`markdown-it-cjk-friendly`をインポートし、次のようにプラグインを使用してください。</span>
|
|
77
|
+
|
|
78
|
+
<span lang="zh-Hans-CN">通过 `markdown-it` 和 `markdown-it-cjk-friendly` 导入,然后使用插件如下:</span>
|
|
79
|
+
|
|
80
|
+
<span lang="ko">`markdown-it`와 `markdown-it-cjk-friendly`를 임포트하고 다음과 같이 플러그인을 사용하세요.</span>
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
import MarkdownIt from "markdown-it";
|
|
84
|
+
import markdownItCjkFriendly from "markdown-it-cjk-friendly";
|
|
85
|
+
|
|
86
|
+
const md = MarkdownIt();
|
|
87
|
+
md.use(markdownItCjkFriendly);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Contributing / <span lang="ja">貢献</span> / <span lang="zh-Hans-CN">贡献</span> / <span lang="ko">기여</span>
|
|
91
|
+
|
|
92
|
+
### Setup
|
|
93
|
+
|
|
94
|
+
Install the dependencies:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pnpm install
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Get Started
|
|
101
|
+
|
|
102
|
+
Build the library:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pnpm build
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Build the library in watch mode:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
pnpm dev
|
|
112
|
+
```
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
default: ()=>markdownItCjFriendlyPlugin
|
|
30
|
+
});
|
|
31
|
+
const external_get_east_asian_width_namespaceObject = require("get-east-asian-width");
|
|
32
|
+
const utils_mjs_namespaceObject = require("markdown-it/lib/common/utils.mjs");
|
|
33
|
+
function isCjkBase(uc) {
|
|
34
|
+
const eaw = (0, external_get_east_asian_width_namespaceObject.eastAsianWidthType)(uc);
|
|
35
|
+
switch(eaw){
|
|
36
|
+
case "fullwidth":
|
|
37
|
+
case "halfwidth":
|
|
38
|
+
return true;
|
|
39
|
+
case "wide":
|
|
40
|
+
return !/^\p{RGI_Emoji}/v.test(String.fromCodePoint(uc));
|
|
41
|
+
case "narrow":
|
|
42
|
+
return false;
|
|
43
|
+
case "ambiguous":
|
|
44
|
+
return 0xe0100 <= uc && uc <= 0xe01ef && null;
|
|
45
|
+
case "neutral":
|
|
46
|
+
return /^\p{sc=Hangul}/u.test(String.fromCodePoint(uc));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function isCjk(uc) {
|
|
50
|
+
return isCjkBase(uc) ?? false;
|
|
51
|
+
}
|
|
52
|
+
function isCjkOrIvs(uc) {
|
|
53
|
+
const raw = isCjkBase(uc);
|
|
54
|
+
return null === raw || raw;
|
|
55
|
+
}
|
|
56
|
+
function maybeHanSVS(uc) {
|
|
57
|
+
return (0xfff0 & uc) === 0xfe00 && (uc >= 0xfe00 && uc <= 0xfe02 || 0xfe0e === uc);
|
|
58
|
+
}
|
|
59
|
+
function markdownItCjFriendlyPlugin(md) {
|
|
60
|
+
const PreviousState = md.inline.State;
|
|
61
|
+
class CjFriendlyState extends PreviousState {
|
|
62
|
+
scanDelims(start, canSplitWord) {
|
|
63
|
+
const max = this.posMax;
|
|
64
|
+
const marker = this.src.charCodeAt(start);
|
|
65
|
+
let [lastChar, lastCharPos] = getLastCharCode(this.src, start);
|
|
66
|
+
if (maybeHanSVS(lastChar)) [lastChar, lastCharPos] = getLastCharCode(this.src, lastCharPos);
|
|
67
|
+
let pos = start;
|
|
68
|
+
while(pos < max && this.src.charCodeAt(pos) === marker)pos++;
|
|
69
|
+
const count = pos - start;
|
|
70
|
+
const nextChar = pos < max ? this.src.codePointAt(pos) : 0x20;
|
|
71
|
+
const isLastPunctChar = (0, utils_mjs_namespaceObject.isMdAsciiPunct)(lastChar) || (0, utils_mjs_namespaceObject.isPunctChar)(String.fromCodePoint(lastChar));
|
|
72
|
+
const isNextPunctChar = (0, utils_mjs_namespaceObject.isMdAsciiPunct)(nextChar) || (0, utils_mjs_namespaceObject.isPunctChar)(String.fromCodePoint(nextChar));
|
|
73
|
+
const isLastWhiteSpace = (0, utils_mjs_namespaceObject.isWhiteSpace)(lastChar);
|
|
74
|
+
const isNextWhiteSpace = (0, utils_mjs_namespaceObject.isWhiteSpace)(nextChar);
|
|
75
|
+
const isLastCJKChar = isCjkOrIvs(lastChar);
|
|
76
|
+
const isNextCJKChar = isCjk(nextChar);
|
|
77
|
+
const adjacentToCjChar = isLastCJKChar || isNextCJKChar;
|
|
78
|
+
const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar || adjacentToCjChar);
|
|
79
|
+
const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar || adjacentToCjChar);
|
|
80
|
+
const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar);
|
|
81
|
+
const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar);
|
|
82
|
+
return {
|
|
83
|
+
can_open,
|
|
84
|
+
can_close,
|
|
85
|
+
length: count
|
|
86
|
+
};
|
|
87
|
+
function getLastCharCode(str, pos) {
|
|
88
|
+
if (pos <= 0) return [
|
|
89
|
+
0x20,
|
|
90
|
+
-1
|
|
91
|
+
];
|
|
92
|
+
const charCode = str.charCodeAt(pos - 1);
|
|
93
|
+
if ((0xfc00 & charCode) !== 0xdc00) return [
|
|
94
|
+
charCode,
|
|
95
|
+
pos - 1
|
|
96
|
+
];
|
|
97
|
+
const codePoint = str.codePointAt(pos - 2);
|
|
98
|
+
return codePoint > 0xffff ? [
|
|
99
|
+
codePoint,
|
|
100
|
+
pos - 2
|
|
101
|
+
] : [
|
|
102
|
+
charCode,
|
|
103
|
+
pos - 1
|
|
104
|
+
];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
md.inline.State = CjFriendlyState;
|
|
109
|
+
}
|
|
110
|
+
var __webpack_export_target__ = exports;
|
|
111
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
112
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
113
|
+
value: true
|
|
114
|
+
});
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_get_east_asian_width_c890dec0__ from "get-east-asian-width";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_markdown_it_lib_common_utils_mjs_c48a6852__ from "markdown-it/lib/common/utils.mjs";
|
|
3
|
+
function isCjkBase(uc) {
|
|
4
|
+
const eaw = (0, __WEBPACK_EXTERNAL_MODULE_get_east_asian_width_c890dec0__.eastAsianWidthType)(uc);
|
|
5
|
+
switch(eaw){
|
|
6
|
+
case "fullwidth":
|
|
7
|
+
case "halfwidth":
|
|
8
|
+
return true;
|
|
9
|
+
case "wide":
|
|
10
|
+
return !/^\p{RGI_Emoji}/v.test(String.fromCodePoint(uc));
|
|
11
|
+
case "narrow":
|
|
12
|
+
return false;
|
|
13
|
+
case "ambiguous":
|
|
14
|
+
return 0xe0100 <= uc && uc <= 0xe01ef && null;
|
|
15
|
+
case "neutral":
|
|
16
|
+
return /^\p{sc=Hangul}/u.test(String.fromCodePoint(uc));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function isCjk(uc) {
|
|
20
|
+
return isCjkBase(uc) ?? false;
|
|
21
|
+
}
|
|
22
|
+
function isCjkOrIvs(uc) {
|
|
23
|
+
const raw = isCjkBase(uc);
|
|
24
|
+
return null === raw || raw;
|
|
25
|
+
}
|
|
26
|
+
function maybeHanSVS(uc) {
|
|
27
|
+
return (0xfff0 & uc) === 0xfe00 && (uc >= 0xfe00 && uc <= 0xfe02 || 0xfe0e === uc);
|
|
28
|
+
}
|
|
29
|
+
function markdownItCjFriendlyPlugin(md) {
|
|
30
|
+
const PreviousState = md.inline.State;
|
|
31
|
+
class CjFriendlyState extends PreviousState {
|
|
32
|
+
scanDelims(start, canSplitWord) {
|
|
33
|
+
const max = this.posMax;
|
|
34
|
+
const marker = this.src.charCodeAt(start);
|
|
35
|
+
let [lastChar, lastCharPos] = getLastCharCode(this.src, start);
|
|
36
|
+
if (maybeHanSVS(lastChar)) [lastChar, lastCharPos] = getLastCharCode(this.src, lastCharPos);
|
|
37
|
+
let pos = start;
|
|
38
|
+
while(pos < max && this.src.charCodeAt(pos) === marker)pos++;
|
|
39
|
+
const count = pos - start;
|
|
40
|
+
const nextChar = pos < max ? this.src.codePointAt(pos) : 0x20;
|
|
41
|
+
const isLastPunctChar = (0, __WEBPACK_EXTERNAL_MODULE_markdown_it_lib_common_utils_mjs_c48a6852__.isMdAsciiPunct)(lastChar) || (0, __WEBPACK_EXTERNAL_MODULE_markdown_it_lib_common_utils_mjs_c48a6852__.isPunctChar)(String.fromCodePoint(lastChar));
|
|
42
|
+
const isNextPunctChar = (0, __WEBPACK_EXTERNAL_MODULE_markdown_it_lib_common_utils_mjs_c48a6852__.isMdAsciiPunct)(nextChar) || (0, __WEBPACK_EXTERNAL_MODULE_markdown_it_lib_common_utils_mjs_c48a6852__.isPunctChar)(String.fromCodePoint(nextChar));
|
|
43
|
+
const isLastWhiteSpace = (0, __WEBPACK_EXTERNAL_MODULE_markdown_it_lib_common_utils_mjs_c48a6852__.isWhiteSpace)(lastChar);
|
|
44
|
+
const isNextWhiteSpace = (0, __WEBPACK_EXTERNAL_MODULE_markdown_it_lib_common_utils_mjs_c48a6852__.isWhiteSpace)(nextChar);
|
|
45
|
+
const isLastCJKChar = isCjkOrIvs(lastChar);
|
|
46
|
+
const isNextCJKChar = isCjk(nextChar);
|
|
47
|
+
const adjacentToCjChar = isLastCJKChar || isNextCJKChar;
|
|
48
|
+
const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar || adjacentToCjChar);
|
|
49
|
+
const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar || adjacentToCjChar);
|
|
50
|
+
const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar);
|
|
51
|
+
const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar);
|
|
52
|
+
return {
|
|
53
|
+
can_open,
|
|
54
|
+
can_close,
|
|
55
|
+
length: count
|
|
56
|
+
};
|
|
57
|
+
function getLastCharCode(str, pos) {
|
|
58
|
+
if (pos <= 0) return [
|
|
59
|
+
0x20,
|
|
60
|
+
-1
|
|
61
|
+
];
|
|
62
|
+
const charCode = str.charCodeAt(pos - 1);
|
|
63
|
+
if ((0xfc00 & charCode) !== 0xdc00) return [
|
|
64
|
+
charCode,
|
|
65
|
+
pos - 1
|
|
66
|
+
];
|
|
67
|
+
const codePoint = str.codePointAt(pos - 2);
|
|
68
|
+
return codePoint > 0xffff ? [
|
|
69
|
+
codePoint,
|
|
70
|
+
pos - 2
|
|
71
|
+
] : [
|
|
72
|
+
charCode,
|
|
73
|
+
pos - 1
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
md.inline.State = CjFriendlyState;
|
|
79
|
+
}
|
|
80
|
+
export { markdownItCjFriendlyPlugin as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "markdown-it-cjk-friendly",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"module-sync": "./dist/index.js",
|
|
10
|
+
"require": "./dist/index.cjs"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/index.cjs",
|
|
14
|
+
"module": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"files": ["dist", "LICENSE", "README.md"],
|
|
17
|
+
"repository": {
|
|
18
|
+
"url": "https://github.com/tats-u/markdown-cjk-friendly"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": "Tatsunori Uchino <tats.u@live.jp> (https://github.com/tats-u)",
|
|
22
|
+
"bugs": "https://github.com/tats-u/markdown-cjk-friendly/issues",
|
|
23
|
+
"keywords": [
|
|
24
|
+
"markdown-it-plugin",
|
|
25
|
+
"markdown-it",
|
|
26
|
+
"markdown",
|
|
27
|
+
"japanese",
|
|
28
|
+
"chinese",
|
|
29
|
+
"korean",
|
|
30
|
+
"cjk"
|
|
31
|
+
],
|
|
32
|
+
"description": "markdown-it plugin to make Markdown emphasis (`**`) in CommonMark more friendly with Chinese, Japanese, and Korean (CJK)",
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "rslib build",
|
|
35
|
+
"dev": "rslib build --watch",
|
|
36
|
+
"test": "vitest --run",
|
|
37
|
+
"test:up": "vitest -u",
|
|
38
|
+
"test:watch": "vitest watch",
|
|
39
|
+
"lint:type": "tsc --noEmit",
|
|
40
|
+
"prepack": "node -e \"require('fs').cpSync('../../LICENSE', './LICENSE')\""
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@rslib/core": "^0.3.1",
|
|
44
|
+
"@types/markdown-it": "^14.1.2",
|
|
45
|
+
"markdown-it": "^14.1.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@types/markdown-it": "*",
|
|
49
|
+
"markdown-it": "*"
|
|
50
|
+
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"@types/markdown-it": {
|
|
53
|
+
"optional": true
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"get-east-asian-width": "^1.3.0"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=20"
|
|
61
|
+
}
|
|
62
|
+
}
|