remark-cjk-friendly 0.1.0 → 1.0.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 CHANGED
@@ -1,22 +1,28 @@
1
- Copyright (c) 2024 Tatsunori Uchino, and authors and contributors of original packages
1
+ Copyright (c) 2025 Tatsunori Uchino <tats.u@live.jp>
2
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:
3
+ MIT LICENSE
4
+
5
+ Based on remark-gfm:
6
+
7
+ (The MIT License)
8
+
9
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining
12
+ a copy of this software and associated documentation files (the
13
+ 'Software'), to deal in the Software without restriction, including
14
+ without limitation the rights to use, copy, modify, merge, publish,
15
+ distribute, sublicense, and/or sell copies of the Software, and to
16
+ permit persons to whom the Software is furnished to do so, subject to
17
+ the following conditions:
11
18
 
12
19
  The above copyright notice and this permission notice shall be
13
20
  included in all copies or substantial portions of the Software.
14
21
 
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.
22
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
23
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
26
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  [![Version](https://img.shields.io/npm/v/remark-cjk-friendly)](https://npmjs.com/package/remark-cjk-friendly) [![NPM Downloads](https://img.shields.io/npm/dw/remark-cjk-friendly)](https://npmjs.com/package/remark-cjk-friendly) [![NPM Last Update](https://img.shields.io/npm/last-update/remark-cjk-friendly)](https://npmjs.com/package/remark-cjk-friendly)
4
4
 
5
- A [remark](https://github.com/remarkjs/remark) plugin to make Markdown emphasis (`**`) in CommonMark compatible with Chinese, Japanese, and Korean (CJK).
5
+ A [remark](https://github.com/remarkjs/remark) plugin to make Markdown emphasis (`**`) in CommonMark (and MDX) compatible with Chinese, Japanese, and Korean (CJK).
6
6
 
7
- <span lang="ja">CommonMarkの強調記号(`**`)を日本語・中国語・韓国語にきちんと対応させるための[remark](https://github.com/remarkjs/remark)プラグイン</span>
7
+ <span lang="ja">CommonMark(・MDX)の強調記号(`**`)を日本語・中国語・韓国語にきちんと対応させるための[remark](https://github.com/remarkjs/remark)プラグイン</span>
8
8
 
9
- <span lang="zh-Hans-CN">一个 [remark](https://github.com/remarkjs/remark) 插件,用于使 CommonMark 的强调标记(`**`)能够正确支持中文、日语和韩语文本。</span>
9
+ <span lang="zh-Hans-CN">一个 [remark](https://github.com/remarkjs/remark) 插件,用于使 CommonMark(和 MDX)的强调标记(`**`)能够正确支持中文、日语和韩语文本。</span>
10
10
 
11
- <span lang="ko">CommonMark의 강조 표시(`**`) 를 한국어, 중국어, 일본어와 호환되도록 만드는 [remark](https://github.com/remarkjs/remark) 플러그인</span>
11
+ <span lang="ko">CommonMark(및 MDX)의 강조 표시(`**`)를 한국어, 중국어, 일본어와 호환되도록 만드는 [remark](https://github.com/remarkjs/remark) 플러그인</span>
12
12
 
13
13
  ## Problem / <span lang="ja">問題</span> / <span lang="zh-Hans-CN">问题</span> / <span lang="ko">문제점</span>
14
14
 
@@ -93,13 +93,13 @@ If you use another package manager, please replace `npm install` with the comman
93
93
 
94
94
  ## Usage / <span lang="ja">使い方</span> / <span lang="zh-Hans-CN">用法</span> / <span lang="ko">사용법</span>
95
95
 
96
- Import `remark` and `remark-cjk-friendly`, and use the plugin as follows:
96
+ Import `remark-cjk-friendly` with other remark-related packages, and use the plugin as follows:
97
97
 
98
- <span lang="ja">`remark`と`remark-cjk-friendly`をインポートし、次のようにプラグインを使用してください。</span>
98
+ <span lang="ja">`remark-cjk-friendly`を他のremark関連パッケージと一緒にインポートし、次のようにプラグインを使用してください。</span>
99
99
 
100
- <span lang="zh-Hans-CN">通过 `remark` 和 `remark-cjk-friendly` 导入,然后使用插件如下:</span>
100
+ <span lang="zh-Hans-CN">将 `remark-cjk-friendly` 与其他 remark 相关的包一起导入,然后使用插件如下:</span>
101
101
 
102
- <span lang="ko">`remark`와 `remark-cjk-friendly`를 임포트하고 다음과 같이 플러그인을 사용하세요.</span>
102
+ <span lang="ko">`remark-cjk-friendly`를 다른 remark 관련 패키지와 함께 가져온 후 다음과 같이 플러그인을 사용하세요.</span>
103
103
 
104
104
  ```js
105
105
  import rehypeStringify from "rehype-stringify";
@@ -120,10 +120,51 @@ const processor = unified()
120
120
  const htmlResult = (await processor.process(markdownString)).toString();
121
121
  ```
122
122
 
123
+ For MDX, add `remarkCjkFriendly` to the `remarkPlugins` array in the config object:
124
+
125
+ <span lang="ja">MDXでは、設定オブジェクトの`remarkPlugins`配列に`remarkCjkFriendly`を追加してください。</span>
126
+
127
+ <span lang="zh-Hans-CN">对于 MDX,将 `remarkCjkFriendly` 添加到配置对象的 `remarkPlugins` 数组中。</span>
128
+
129
+ <span lang="ko">MDX의 경우, `remarkCjkFriendly`를 `remarkPlugins` 배열에 추가해주세요.</span>
130
+
131
+ ```js
132
+ const someMdxConfig = {
133
+ remarkPlugins: [remarkGfm, remarkCjkFriendly, ...otherRemarkPlugins],
134
+ rehypePlugins: [...someRehypePlugins],
135
+ };
136
+ ```
137
+
138
+ In [Rspress](https://rspress.dev/guide/basic/use-mdx#disabling-the-rust-version-compiler) and [Next.js (`@next/mdx`)](https://nextjs.org/docs/pages/building-your-application/configuring/mdx#using-the-rust-based-mdx-compiler-experimental), you will probably need to set `mdxRs` to `false` to make Rspress use a JavaScript-based and monkey-patchable parser.
139
+
140
+ <span lang="ja">[Rspress](https://rspress.dev/guide/basic/use-mdx#disabling-the-rust-version-compiler)と[Next.js(`@next/mdx`)](https://nextjs.org/docs/pages/building-your-application/configuring/mdx#using-the-rust-based-mdx-compiler-experimental)では、`mdxRs`を`false`に設定して、RspressにJavaScript製でモンキーパッチ可能なパーサを使わせる必要がおそらくあります。</span>
141
+
142
+ <span lang="zh-CN">在[Rspress](https://rspress.dev/zh/guide/basic/use-mdx#%E5%85%B3%E9%97%AD-rust-%E7%89%88%E6%9C%AC%E7%BC%96%E8%AF%91%E5%99%A8)和[Next.js(`@next/mdx`)](https://nextjs.org/docs/pages/building-your-application/configuring/mdx#using-the-rust-based-mdx-compiler-experimental)中,您可能需要将`mdxRs`设置为`false`,以使Rspress使用基于JavaScript且可进行猴子补丁的解析器。</span>
143
+
144
+ <span lang="ko">[Rspress](https://rspress.dev/guide/basic/use-mdx#disabling-the-rust-version-compiler)와 [Next.js(`@next/mdx`)](https://nextjs.org/docs/pages/building-your-application/configuring/mdx#using-the-rust-based-mdx-compiler-experimental)에서는 `mdxRs`를 `false`로 설정하여 Rspress가 JavaScript 기반이며 몽키 패치가 가능한 파서를 사용하도록 해야 할 것 같습니다.</span>
145
+
146
+ ## Compatibility with the other languages / <span lang="ja">他言語との互換性</span> / <span lang="zh-Hans-CN">与其他语言的兼容性</span> / <span lang="ko">다른 언어와의 호환성</span>
147
+
148
+ This modification of the specification does not affect the other languages than Chinese, Japanese, and Korean. Even if your application or document has translations or content in other languages, it will not be affected, so please feel free to use this packages. I assure that even with this package (amendment suggestion), remark still outputs the same HTML for all CommonMark test cases as of 0.31.2.
149
+
150
+ <span lang="ja">この仕様変更提案は、日本語・中国語・韓国語以外の言語には影響しません。アプリケーションやドキュメントに他言語の翻訳やコンテンツが含まれていても影響はありませんので、安心して本パッケージをご利用ください。本パッケージ(修正案)を使用しても、0.31.2時点の全てのCommonMarkテストケースで、remarkが同じHTMLを出力することを保証しています。</span>
151
+
152
+ <span lang="zh-Hans-CN">除中文、日文和韩文外,建议的规范变更不会影响其他语言。请放心使用此软件包,因为如果您的应用程序或文档包含其他语言的翻译或内容,也不会受到影响。我保证,即使使用此软件包(修正建议),remark 仍然会为 0.31.2 版本的所有 CommonMark 测试用例输出相同的 HTML。</span>
153
+
154
+ <span lang="ko">이번 사양 변경 제안은 한국어, 중국어, 일본어 이외의 언어에는 영향을 미치지 않습니다. 애플리케이션이나 문서에 다른 언어의 번역이나 콘텐츠가 포함되어 있어도 영향을 받지 않으므로 안심하고 본 패키지를 사용하시기 바랍니다. 본 패키지(수정안)를 사용해도 0.31.2 시점의 모든 CommonMark 테스트케이스에서 remark가 동일한 HTML을 출력하는 것을 보장합니다.</span>
155
+
123
156
  ## Specification / <span lang="ja">規格書</span> / <span lang="zh-Hans-CN">规范</span> / <span lang="ko">규정서</span>
124
157
 
125
158
  https://github.com/tats-u/markdown-cjk-friendly/blob/main/specification.md (English)
126
159
 
160
+ ## Related packages / <span lang="ja">関連パッケージ</span> / <span lang="zh-Hans-CN">相关包</span> / <span lang="ko">관련 패키지</span>
161
+
162
+ - [micromark-extension-cjk-friendly](https://npmjs.com/package/micromark-extension-cjk-friendly) [![Version](https://img.shields.io/npm/v/micromark-extension-cjk-friendly)](https://npmjs.com/package/micromark-extension-cjk-friendly) [![NPM Downloads](https://img.shields.io/npm/dw/micromark-extension-cjk-friendly)](https://npmjs.com/package/micromark-extension-cjk-friendly) [![NPM Last Update](https://img.shields.io/npm/last-update/micromark-extension-cjk-friendly)](https://npmjs.com/package/micromark-extension-cjk-friendly)
163
+ - [micromark-extension-cjk-friendly-util](https://npmjs.com/package/micromark-extension-cjk-friendly-util) [![Version](https://img.shields.io/npm/v/micromark-extension-cjk-friendly-util)](https://npmjs.com/package/micromark-extension-cjk-friendly-util) [![NPM Downloads](https://img.shields.io/npm/dw/micromark-extension-cjk-friendly-util)](https://npmjs.com/package/micromark-extension-cjk-friendly-util) [![NPM Last Update](https://img.shields.io/npm/last-update/micromark-extension-cjk-friendly-util)](https://npmjs.com/package/micromark-extension-cjk-friendly-util)
164
+ - [micromark-extension-cjk-friendly-gfm-strikethrough](https://npmjs.com/package/micromark-extension-cjk-friendly-gfm-strikethrough) [![Version](https://img.shields.io/npm/v/micromark-extension-cjk-friendly-gfm-strikethrough)](https://npmjs.com/package/micromark-extension-cjk-friendly-gfm-strikethrough) [![NPM Downloads](https://img.shields.io/npm/dw/micromark-extension-cjk-friendly-gfm-strikethrough)](https://npmjs.com/package/micromark-extension-cjk-friendly-gfm-strikethrough) [![NPM Last Update](https://img.shields.io/npm/last-update/micromark-extension-cjk-friendly-gfm-strikethrough)](https://npmjs.com/package/micromark-extension-cjk-friendly-gfm-strikethrough)
165
+
166
+ - [markdown-it-cjk-friendly](https://npmjs.com/package/markdown-it-cjk-friendly) [![Version](https://img.shields.io/npm/v/markdown-it-cjk-friendly)](https://npmjs.com/package/markdown-it-cjk-friendly) [![NPM Downloads](https://img.shields.io/npm/dw/markdown-it-cjk-friendly)](https://npmjs.com/package/markdown-it-cjk-friendly) [![NPM Last Update](https://img.shields.io/npm/last-update/markdown-it-cjk-friendly)](https://npmjs.com/package/markdown-it-cjk-friendly)
167
+
127
168
  ## Contributing / <span lang="ja">貢献</span> / <span lang="zh-Hans-CN">贡献</span> / <span lang="ko">기여</span>
128
169
 
129
170
  ### Setup
package/package.json CHANGED
@@ -1,18 +1,13 @@
1
1
  {
2
2
  "name": "remark-cjk-friendly",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
8
- "import": "./dist/index.js",
9
- "module-sync": "./dist/index.js",
10
- "require": "./dist/index.cjs"
8
+ "default": "./dist/index.js"
11
9
  }
12
10
  },
13
- "main": "./dist/index.cjs",
14
- "module": "./dist/index.js",
15
- "types": "./dist/index.d.ts",
16
11
  "files": [
17
12
  "dist",
18
13
  "LICENSE",
@@ -35,13 +30,13 @@
35
30
  "mdast",
36
31
  "unified"
37
32
  ],
38
- "description": "remark plugin to make Markdown emphasis (`**`) in CommonMark more friendly with Chinese, Japanese, and Korean (CJK)",
33
+ "description": "remark plugin to make Markdown emphasis (`**`) in CommonMark (and MDX) more friendly with Chinese, Japanese, and Korean (CJK)",
39
34
  "sideEffects": false,
40
35
  "dependencies": {
41
36
  "micromark-extension-cjk-friendly": "<2.0.0"
42
37
  },
43
38
  "devDependencies": {
44
- "@rslib/core": "^0.3.1",
39
+ "@mdx-js/mdx": "^3.1.0",
45
40
  "rehype-stringify": "10.0.1",
46
41
  "remark": "^15.0.1",
47
42
  "remark-gfm": "^4.0.0",
package/dist/index.cjs DELETED
@@ -1,41 +0,0 @@
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: ()=>remarkCjkFriendly
30
- });
31
- const external_micromark_extension_cjk_friendly_namespaceObject = require("micromark-extension-cjk-friendly");
32
- function remarkCjkFriendly() {
33
- const data = this.data();
34
- const micromarkExtensions = data.micromarkExtensions || (data.micromarkExtensions = []);
35
- micromarkExtensions.push((0, external_micromark_extension_cjk_friendly_namespaceObject.cjkFriendlyExtension)());
36
- }
37
- var __webpack_export_target__ = exports;
38
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
39
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
40
- value: true
41
- });