@mdit/plugin-cjk-breaks 0.0.0-stage → 1.0.1
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 +50 -0
- package/README.md +31 -2
- package/dist/cdn.umd.js +2 -0
- package/dist/cdn.umd.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +61 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2022 - PRESENT by MrHope
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
22
|
+
|
|
23
|
+
------------------------------------------------------------------------------
|
|
24
|
+
Third-party notices
|
|
25
|
+
|
|
26
|
+
This package includes code derived from `markdown-it-cjk-breaks`
|
|
27
|
+
(https://github.com/markdown-it/markdown-it-cjk-breaks), which is licensed
|
|
28
|
+
under the MIT License:
|
|
29
|
+
|
|
30
|
+
Copyright (c) 2018 Authors.
|
|
31
|
+
|
|
32
|
+
The MIT License (MIT)
|
|
33
|
+
|
|
34
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
35
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
36
|
+
in the Software without restriction, including without limitation the rights
|
|
37
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
38
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
39
|
+
furnished to do so, subject to the following conditions:
|
|
40
|
+
|
|
41
|
+
The above copyright notice and this permission notice shall be included in
|
|
42
|
+
all copies or substantial portions of the Software.
|
|
43
|
+
|
|
44
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
45
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
46
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
47
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
48
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
49
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
50
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mdit/plugin-cjk-breaks
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[  ](https://www.npmjs.com/package/@mdit/plugin-cjk-breaks)
|
|
4
|
+
|
|
5
|
+
CJK line-break plugin for MarkdownIt.
|
|
6
|
+
|
|
7
|
+
## [Docs](https://mdit-plugins.github.io/cjk-breaks.html) | [文档](https://mdit-plugins.github.io/zh/cjk-breaks.html)
|
|
8
|
+
|
|
9
|
+
## Install / 安装
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# pnpm
|
|
13
|
+
pnpm add -D @mdit/plugin-cjk-breaks
|
|
14
|
+
# npm
|
|
15
|
+
npm i -D @mdit/plugin-cjk-breaks
|
|
16
|
+
# yarn
|
|
17
|
+
yarn add -D @mdit/plugin-cjk-breaks
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Comparison / 对比
|
|
21
|
+
|
|
22
|
+
Compared against the upstream [`markdown-it-cjk-breaks`](https://www.npmjs.com/package/markdown-it-cjk-breaks) package `2.0.1`.
|
|
23
|
+
|
|
24
|
+
- Correctness: **22/22** cases match the reference exactly.
|
|
25
|
+
- Throughput: **1.02×** the reference (geometric mean across 6 benchmark cases; above 1× means faster).
|
|
26
|
+
- Entry gzip: **673 B** versus **921 B** for the reference (import cost).
|
|
27
|
+
|
|
28
|
+
See the full comparison report: [English](https://mdit-plugins.github.io/compare.html) · [中文](https://mdit-plugins.github.io/zh/compare.html).
|
|
29
|
+
|
|
30
|
+
## Acknowledgements / 鸣谢
|
|
31
|
+
|
|
32
|
+
Rewritten from [markdown-it-cjk-breaks](https://github.com/markdown-it/markdown-it-cjk-breaks).
|
package/dist/cdn.umd.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.mdItPluginCjkBreaks={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),String.raw`\$&`;let t=(e,t,n)=>(n?[e[n].ruler]:[e.core.ruler,e.block.ruler,e.inline.ruler]).some(e=>e.__rules__.some(({name:e})=>e===t));String.raw`\^$.*+?()[]{}|`;let n=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],r=[12288,12288,65281,65376,65504,65510],i=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],a=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],o=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141],s=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},c=19968,[l,u]=/* #__PURE__ */ d(o);function d(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(c>=i&&c<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}let f=e=>e<161||e>1114109?!1:s(n,e),p=e=>e<12288||e>65510?!1:s(r,e),m=e=>e<8361||e>65518?!1:s(i,e),h=e=>e<32||e>10630?!1:s(a,e),g=e=>e>=l&&e<=u?!0:e<4352||e>262141?!1:s(o,e);function _(e){return f(e)?`ambiguous`:p(e)?`fullwidth`:m(e)?`halfwidth`:h(e)?`narrow`:g(e)?`wide`:`neutral`}function v(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function y(e){return v(e),_(e)}let b=/[\u302E\u302F\u1100-\u11FF\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/u,x=(e,t)=>e>=55296&&e<=56319&&t>=56320&&t<=57343,S=e=>b.test(e),C=e=>{let t=y(e.codePointAt(0));return t===`fullwidth`||t===`wide`||t===`halfwidth`},w=e=>{for(let t=0;t<e.length;t++){let n=e[t];if(n.type!==`softbreak`)continue;let r=` `,i=` `;for(let n=t-1;n>=0;n--){let t=e[n];if(t.type!==`text`)continue;if(t.content.length===0)break;let i=t.content.charCodeAt(t.content.length-2),a=t.content.charCodeAt(t.content.length-1);r=t.content.slice(x(i,a)?-2:-1);break}for(let n=t+1;n<e.length;n++){let t=e[n];if(t.type!==`text`)continue;if(t.content.length===0)break;let r=t.content.charCodeAt(0),a=t.content.charCodeAt(1);i=t.content.slice(0,x(r,a)?2:1);break}let a=!1;(r===``||i===``)&&(a=!0),C(r)&&C(i)&&!S(r)&&!S(i)&&(a=!0),a&&(n.type=`text`,n.content=``)}},T=e=>{for(let t=e.tokens.length-1;t>=0;t--){let n=e.tokens[t];n.type===`inline`&&w(n.children)}};e.cjkBreaks=e=>{t(e,`cjk_breaks`,`core`)||e.core.ruler.push(`cjk_breaks`,T)}});
|
|
2
|
+
//# sourceMappingURL=cdn.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdn.umd.js","names":["hasRule","factory","global","exports","c","ambiguousRanges","fullwidthRanges","halfwidthRanges","narrowRanges","wideRanges","isInRange","low","high","ranges","mid","i","codePoint","commonCjkCodePoint","wideFastPathStart","wideFastPathEnd","findWideFastPathRange","fastPathStart","fastPathEnd","index","start","end","isAmbiguous","isFullwidth","isHalfwidth","isNarrow","isWide","getCategory","validate","eastAsianWidthType","HANGUL_RE","isSurrogatePair","c1","c2","isHangul","char","isFwh","eastAsianWidth","processInlines","tokens","token","last","next","cursor","previousToken","nextToken","removeBreak","cjkBreaksRule","blockIndex","state","blockToken","md"],"sources":["../../helper/dist/index.js","../../../../../../setup-pnpm/store/v11/links/@/get-east-asian-width/1.7.0/b34397dc3f09e5f6482579f99d7b9680df7c347e6788e2d79acec356eeb6ff79/node_modules/get-east-asian-width/lookup-data.js","../../../../../../setup-pnpm/store/v11/links/@/get-east-asian-width/1.7.0/b34397dc3f09e5f6482579f99d7b9680df7c347e6788e2d79acec356eeb6ff79/node_modules/get-east-asian-width/utilities.js","../../../../../../setup-pnpm/store/v11/links/@/get-east-asian-width/1.7.0/b34397dc3f09e5f6482579f99d7b9680df7c347e6788e2d79acec356eeb6ff79/node_modules/get-east-asian-width/lookup.js","../../../../../../setup-pnpm/store/v11/links/@/get-east-asian-width/1.7.0/b34397dc3f09e5f6482579f99d7b9680df7c347e6788e2d79acec356eeb6ff79/node_modules/get-east-asian-width/index.js","../src/plugin.ts"],"sourcesContent":["const e=e=>{let t=e.split(`\n`),n=1/0;for(let r=0;r<t.length;r++){let i=t[r],{length:a}=i;for(let t=0;t<a;t++){let r=i.charCodeAt(t);if(r!==32&&r!==9){if(t===0)return e;t<n&&(n=t);break}}}return n===1/0?e:t.map(e=>e.slice(n)).join(`\n`)},t=/[-/\\\\^$*+?.()|[\\]{}]/g,n=String.raw`\\$&`,r=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`\"`,`"`).replaceAll(`'`,`'`),i=e=>e.replaceAll(t,n),a=(e,t,n,r)=>{let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-r>=4||i+3>a)return null;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return null;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return null;let l=e.src.slice(i,a);if(o===96&&l.includes(\"`\"))return null;let u=t,d=!1;for(;u++,!(u>=n||(i=s=e.bMarks[u]+e.tShift[u],a=e.eMarks[u],i<a&&e.sCount[u]<r));)if(e.src.charCodeAt(i)===o&&!(e.sCount[u]-r>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){d=!0;break}return u+ +!!d},o=/\\r\\n?|\\n/g,s=/\\\\(?<char>[ \\\\!\"#$%&'()*+,./:;<=>?@[\\]^_`{|}~-])/gu,c=(e,t,n)=>(n?[e[n].ruler]:[e.core.ruler,e.block.ruler,e.inline.ruler]).some(e=>e.__rules__.some(({name:e})=>e===t)),l=String.raw`\\^$.*+?()[]{}|`,u=[`.env`,`.env.*`,`.npmrc`,`.netrc`,`.git-credentials`,`id_rsa*`,`id_ed25519*`,`*.pem`,`*.key`,`*.p12`,`.git/**`,`**/.git/**`,`.ssh/**`,`**/.ssh/**`,`.aws/**`,`**/.aws/**`,`.azure/**`,`**/.azure/**`,`.kube/**`,`**/.kube/**`,`.docker/config.json`,`**/.docker/config.json`,`*.tfstate*`],d=e=>{let t=`^`,{length:n}=e;for(let r=0;r<n;r++){let n=e[r];n===`*`?e.charCodeAt(r+1)===42?(r++,e.charCodeAt(r+1)===47?(r++,t+=`(?:.*/)?`):t+=`.*`):t+=`[^/]*`:t+=n===`?`?`[^/]`:l.includes(n)?`\\\\${n}`:n}return RegExp(`${t}$`)},f=/* @__PURE__ */ new Map,p=e=>{let t=f.get(e);if(t)return t;let n=d(e);return f.set(e,n),n},m=(e,t)=>((e.global||e.sticky)&&(e.lastIndex=0),e.test(t)),h=(e,t=u)=>{let n=e.lastIndexOf(`/`),r=n===-1?e:e.slice(n+1);for(let n of t)if(typeof n==`string`){let t=n.includes(`/`)?e:r;if(p(n).test(t))return!0}else if(m(n,e)||m(n,r))return!0;return!1};export{o as NEWLINE_RE,s as UNESCAPE_RE,e as dedent,u as defaultSensitiveFiles,r as escapeHtml,i as escapeRegExp,c as hasRule,h as isSensitiveFile,a as scanFence};\n//# sourceMappingURL=index.js.map","// Generated by scripts/build.js\n\nexport const ambiguousMinimalCodePoint = 161;\nexport const ambiguousMaximumCodePoint = 1114109;\nexport const ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];\n\nexport const fullwidthMinimalCodePoint = 12288;\nexport const fullwidthMaximumCodePoint = 65510;\nexport const fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];\n\nexport const halfwidthMinimalCodePoint = 8361;\nexport const halfwidthMaximumCodePoint = 65518;\nexport const halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];\n\nexport const narrowMinimalCodePoint = 32;\nexport const narrowMaximumCodePoint = 10630;\nexport const narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];\n\nexport const wideMinimalCodePoint = 4352;\nexport const wideMaximumCodePoint = 262141;\nexport const wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101594, 101631, 101664, 101760, 101874, 101888, 102801, 102816, 102866, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110888, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110952, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127406, 127406, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128729, 128732, 128735, 128747, 128748, 128756, 128764, 128986, 128986, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129734, 129736, 129736, 129740, 129757, 129759, 129771, 129775, 129786, 131072, 196605, 196608, 262141];\n","/**\nBinary search on a sorted flat array of [start, end] pairs.\n\n@param {number[]} ranges - Flat array of inclusive [start, end] range pairs, e.g. [0, 5, 10, 20].\n@param {number} codePoint - The value to search for.\n@returns {boolean} Whether the value falls within any of the ranges.\n*/\nexport const isInRange = (ranges, codePoint) => {\n\tlet low = 0;\n\tlet high = Math.floor(ranges.length / 2) - 1;\n\twhile (low <= high) {\n\t\tconst mid = Math.floor((low + high) / 2);\n\t\tconst i = mid * 2;\n\t\tif (codePoint < ranges[i]) {\n\t\t\thigh = mid - 1;\n\t\t} else if (codePoint > ranges[i + 1]) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n};\n","import {\n\tambiguousMinimalCodePoint,\n\tambiguousMaximumCodePoint,\n\tambiguousRanges,\n\n\tfullwidthMinimalCodePoint,\n\tfullwidthMaximumCodePoint,\n\tfullwidthRanges,\n\n\thalfwidthMinimalCodePoint,\n\thalfwidthMaximumCodePoint,\n\thalfwidthRanges,\n\n\tnarrowMinimalCodePoint,\n\tnarrowMaximumCodePoint,\n\tnarrowRanges,\n\n\twideMinimalCodePoint,\n\twideMaximumCodePoint,\n\twideRanges,\n} from './lookup-data.js';\nimport {isInRange} from './utilities.js';\n\nconst commonCjkCodePoint = 0x4E_00;\nconst [wideFastPathStart, wideFastPathEnd] = /* #__PURE__ */ findWideFastPathRange(wideRanges);\n\n// Use a hot-path range so common `isWide` calls can skip binary search.\n// The range containing U+4E00 covers common CJK ideographs;\n// fallback to the largest range for resilience to Unicode table changes.\nfunction findWideFastPathRange(ranges) {\n\tlet fastPathStart = ranges[0];\n\tlet fastPathEnd = ranges[1];\n\n\tfor (let index = 0; index < ranges.length; index += 2) {\n\t\tconst start = ranges[index];\n\t\tconst end = ranges[index + 1];\n\n\t\tif (\n\t\t\tcommonCjkCodePoint >= start\n\t\t\t&& commonCjkCodePoint <= end\n\t\t) {\n\t\t\treturn [start, end];\n\t\t}\n\n\t\tif ((end - start) > (fastPathEnd - fastPathStart)) {\n\t\t\tfastPathStart = start;\n\t\t\tfastPathEnd = end;\n\t\t}\n\t}\n\n\treturn [fastPathStart, fastPathEnd];\n}\n\nexport const isAmbiguous = codePoint => {\n\tif (\n\t\tcodePoint < ambiguousMinimalCodePoint\n\t\t|| codePoint > ambiguousMaximumCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(ambiguousRanges, codePoint);\n};\n\nexport const isFullwidth = codePoint => {\n\tif (\n\t\tcodePoint < fullwidthMinimalCodePoint\n\t\t|| codePoint > fullwidthMaximumCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(fullwidthRanges, codePoint);\n};\n\nconst isHalfwidth = codePoint => {\n\tif (\n\t\tcodePoint < halfwidthMinimalCodePoint\n\t\t|| codePoint > halfwidthMaximumCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(halfwidthRanges, codePoint);\n};\n\nconst isNarrow = codePoint => {\n\tif (\n\t\tcodePoint < narrowMinimalCodePoint\n\t\t|| codePoint > narrowMaximumCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(narrowRanges, codePoint);\n};\n\nexport const isWide = codePoint => {\n\tif (\n\t\tcodePoint >= wideFastPathStart\n\t\t&& codePoint <= wideFastPathEnd\n\t) {\n\t\treturn true;\n\t}\n\n\tif (\n\t\tcodePoint < wideMinimalCodePoint\n\t\t|| codePoint > wideMaximumCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(wideRanges, codePoint);\n};\n\nexport function getCategory(codePoint) {\n\tif (isAmbiguous(codePoint)) {\n\t\treturn 'ambiguous';\n\t}\n\n\tif (isFullwidth(codePoint)) {\n\t\treturn 'fullwidth';\n\t}\n\n\tif (isHalfwidth(codePoint)) {\n\t\treturn 'halfwidth';\n\t}\n\n\tif (isNarrow(codePoint)) {\n\t\treturn 'narrow';\n\t}\n\n\tif (isWide(codePoint)) {\n\t\treturn 'wide';\n\t}\n\n\treturn 'neutral';\n}\n","import {getCategory, isAmbiguous, isFullwidth, isWide} from './lookup.js';\n\nfunction validate(codePoint) {\n\tif (!Number.isSafeInteger(codePoint)) {\n\t\tthrow new TypeError(`Expected a code point, got \\`${typeof codePoint}\\`.`);\n\t}\n}\n\nexport function eastAsianWidthType(codePoint) {\n\tvalidate(codePoint);\n\n\treturn getCategory(codePoint);\n}\n\nexport function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {\n\tvalidate(codePoint);\n\n\tif (\n\t\tisFullwidth(codePoint)\n\t\t|| isWide(codePoint)\n\t\t|| (ambiguousAsWide && isAmbiguous(codePoint))\n\t) {\n\t\treturn 2;\n\t}\n\n\treturn 1;\n}\n\n// Private exports for https://github.com/sindresorhus/is-fullwidth-code-point\nexport {\n\tisFullwidth as _isFullwidth,\n\t// TODO: Remove this in the next major version.\n\tisFullwidth as _isFullWidth,\n\tisWide as _isWide,\n} from './lookup.js';\n","/**\n * Forked from `markdown-it-cjk-breaks`\n * (https://github.com/markdown-it/markdown-it-cjk-breaks/blob/master/index.mjs), which is licensed\n * under the MIT License.\n *\n * Copyright (c) 2018 Authors.\n */\n\nimport { hasRule } from \"@mdit/helper\";\nimport type { CoreRule, PluginSimple } from \"@mdit/helper\";\nimport { eastAsianWidthType } from \"get-east-asian-width\";\nimport type { Token } from \"markdown-it\";\n\n/** Zero-width space character / 零宽空格字符 */\nconst ZWSP = \"\\u200B\";\n/** Default character used when an adjacent character is missing / 相邻字符缺失时使用的默认字符 */\nconst SPACE = \" \";\n\n/**\n * Characters whose Script is Hangul (Unicode 10.0)\n *\n * 脚本为韩文的字符(Unicode 10.0)\n */\n// The combining Hangul tone marks must stay at the start of the character class,\n// otherwise `no-misleading-character-class` treats them as a combining sequence.\nconst HANGUL_RE =\n /[\\u302E\\u302F\\u1100-\\u11FF\\u3131-\\u318E\\u3200-\\u321E\\u3260-\\u327E\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFFA0-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/u;\n\n// Check whether two UTF-16 code units form a surrogate pair\nconst isSurrogatePair = (c1: number, c2: number): boolean =>\n c1 >= 0xd800 && c1 <= 0xdbff && c2 >= 0xdc00 && c2 <= 0xdfff;\n\n// Check whether a character belongs to the Hangul script\nconst isHangul = (char: string): boolean => HANGUL_RE.test(char);\n\n// Check whether a character has a fullwidth (F), wide (W) or halfwidth (H) East Asian Width\nconst isFwh = (char: string): boolean => {\n // oxlint-disable-next-line typescript/no-non-null-assertion\n const eastAsianWidth = eastAsianWidthType(char.codePointAt(0)!);\n\n return (\n eastAsianWidth === \"fullwidth\" || eastAsianWidth === \"wide\" || eastAsianWidth === \"halfwidth\"\n );\n};\n\n/**\n * Remove soft breaks that cannot be converted to spaces.\n *\n * 移除无法转换为空格的软换行。\n *\n * This is an internal helper exported for tests only; use the `cjkBreaks` plugin instead.\n *\n * 这是仅为测试而导出的内部函数,请使用 `cjkBreaks` 插件。\n *\n * @param tokens - Inline token children / 行内 token 子节点\n */\nexport const processInlines = (tokens: Token[]): void => {\n for (let index = 0; index < tokens.length; index++) {\n const token = tokens[index];\n\n if (token.type !== \"softbreak\") continue;\n\n // default last/next character to space\n let last = SPACE;\n let next = SPACE;\n\n for (let cursor = index - 1; cursor >= 0; cursor--) {\n const previousToken = tokens[cursor];\n\n if (previousToken.type !== \"text\") continue;\n if (previousToken.content.length === 0) break;\n\n const c1 = previousToken.content.charCodeAt(previousToken.content.length - 2);\n const c2 = previousToken.content.charCodeAt(previousToken.content.length - 1);\n\n last = previousToken.content.slice(isSurrogatePair(c1, c2) ? -2 : -1);\n break;\n }\n\n for (let cursor = index + 1; cursor < tokens.length; cursor++) {\n const nextToken = tokens[cursor];\n\n if (nextToken.type !== \"text\") continue;\n if (nextToken.content.length === 0) break;\n\n const c1 = nextToken.content.charCodeAt(0);\n const c2 = nextToken.content.charCodeAt(1);\n\n next = nextToken.content.slice(0, isSurrogatePair(c1, c2) ? 2 : 1);\n break;\n }\n\n let removeBreak = false;\n\n // remove newline if it's adjacent to ZWSP\n if (last === ZWSP || next === ZWSP) removeBreak = true;\n\n // remove newline if both characters are fullwidth (F), wide (W) or\n // halfwidth (H), but not Hangul\n if (isFwh(last) && isFwh(next) && !isHangul(last) && !isHangul(next)) removeBreak = true;\n\n if (removeBreak) {\n token.type = \"text\";\n token.content = \"\";\n }\n }\n};\n\n// Core rule rewriting soft breaks between East Asian characters\nconst cjkBreaksRule: CoreRule = (state) => {\n for (let blockIndex = state.tokens.length - 1; blockIndex >= 0; blockIndex--) {\n const blockToken = state.tokens[blockIndex];\n\n if (blockToken.type !== \"inline\") continue;\n\n // oxlint-disable-next-line typescript/no-non-null-assertion\n processInlines(blockToken.children!);\n }\n};\n\nexport const cjkBreaks: PluginSimple = (md) => {\n if (hasRule(md, \"cjk_breaks\", \"core\")) return;\n\n md.core.ruler.push(\"cjk_breaks\", cjkBreaksRule);\n};\n"],"ignoreList":[1,2,3,4],"mappings":"C,0RAEgC,OAAO,GAAG,MAAstB,IAAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,EAAE,OAAO,KAAK,EAAA,CAAG,KAAK,GAAG,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,EAAI,OAAO,GAAG,iBCEj4B,IAAaC,EAAkB,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IA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,KACF,CAEA,IAAK,IAAIU,EAASxB,EAAQ,EAAGwB,EAASJ,EAAO,OAAQ,IAAU,CAC7D,IAAMM,EAAYN,EAAOI,GAEzB,GAAIE,EAAU,OAAS,OAAQ,SAC/B,GAAIA,EAAU,QAAQ,SAAW,EAAG,MAEpC,IAAMb,EAAKa,EAAU,QAAQ,WAAW,CAAC,EACnCZ,EAAKY,EAAU,QAAQ,WAAW,CAAC,EAEzC,EAAOA,EAAU,QAAQ,MAAM,EAAGd,EAAgBC,EAAIC,CAAE,EAAI,EAAI,CAAC,EACjE,KACF,CAEA,IAAIa,EAAc,IAGdL,IAAS,KAAQC,IAAS,OAAM,EAAc,IAI9CN,EAAMK,CAAI,GAAKL,EAAMM,CAAI,GAAK,CAACR,EAASO,CAAI,GAAK,CAACP,EAASQ,CAAI,IAAG,EAAc,IAEhFI,IACF,EAAM,KAAO,OACb,EAAM,QAAU,GAEpB,CACF,EAGMC,EAA2B,GAAU,CACzC,IAAK,IAAIC,EAAaC,EAAM,OAAO,OAAS,EAAGD,GAAc,EAAG,IAAc,CAC5E,IAAME,EAAaD,EAAM,OAAOD,GAE5BE,EAAW,OAAS,UAGxBZ,EAAeY,EAAW,QAAS,CACrC,CACF,E,YAEwC,GAAO,CACzCtD,EAAQuD,EAAI,aAAc,MAAM,GAEpCA,EAAG,KAAK,MAAM,KAAK,aAAcJ,CAAa,CAChD,C"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{hasRule as e}from"@mdit/helper";import{eastAsianWidthType as t}from"get-east-asian-width";const n=/[\u302E\u302F\u1100-\u11FF\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/u,r=(e,t)=>e>=55296&&e<=56319&&t>=56320&&t<=57343,i=e=>n.test(e),a=e=>{let n=t(e.codePointAt(0));return n===`fullwidth`||n===`wide`||n===`halfwidth`},o=e=>{for(let t=0;t<e.length;t++){let n=e[t];if(n.type!==`softbreak`)continue;let o=` `,s=` `;for(let n=t-1;n>=0;n--){let t=e[n];if(t.type!==`text`)continue;if(t.content.length===0)break;let i=t.content.charCodeAt(t.content.length-2),a=t.content.charCodeAt(t.content.length-1);o=t.content.slice(r(i,a)?-2:-1);break}for(let n=t+1;n<e.length;n++){let t=e[n];if(t.type!==`text`)continue;if(t.content.length===0)break;let i=t.content.charCodeAt(0),a=t.content.charCodeAt(1);s=t.content.slice(0,r(i,a)?2:1);break}let c=!1;(o===``||s===``)&&(c=!0),a(o)&&a(s)&&!i(o)&&!i(s)&&(c=!0),c&&(n.type=`text`,n.content=``)}},s=e=>{for(let t=e.tokens.length-1;t>=0;t--){let n=e.tokens[t];n.type===`inline`&&o(n.children)}},c=t=>{e(t,`cjk_breaks`,`core`)||t.core.ruler.push(`cjk_breaks`,s)};export{c as cjkBreaks};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["HANGUL_RE","isSurrogatePair","c1","c2","isHangul","char","isFwh","eastAsianWidth","eastAsianWidthType","processInlines","index","tokens","token","last","next","cursor","previousToken","nextToken","removeBreak","cjkBreaksRule","blockIndex","state","blockToken","cjkBreaks","hasRule","md"],"sources":["../src/plugin.ts"],"sourcesContent":["/**\n * Forked from `markdown-it-cjk-breaks`\n * (https://github.com/markdown-it/markdown-it-cjk-breaks/blob/master/index.mjs), which is licensed\n * under the MIT License.\n *\n * Copyright (c) 2018 Authors.\n */\n\nimport { hasRule } from \"@mdit/helper\";\nimport type { CoreRule, PluginSimple } from \"@mdit/helper\";\nimport { eastAsianWidthType } from \"get-east-asian-width\";\nimport type { Token } from \"markdown-it\";\n\n/** Zero-width space character / 零宽空格字符 */\nconst ZWSP = \"\\u200B\";\n/** Default character used when an adjacent character is missing / 相邻字符缺失时使用的默认字符 */\nconst SPACE = \" \";\n\n/**\n * Characters whose Script is Hangul (Unicode 10.0)\n *\n * 脚本为韩文的字符(Unicode 10.0)\n */\n// The combining Hangul tone marks must stay at the start of the character class,\n// otherwise `no-misleading-character-class` treats them as a combining sequence.\nconst HANGUL_RE =\n /[\\u302E\\u302F\\u1100-\\u11FF\\u3131-\\u318E\\u3200-\\u321E\\u3260-\\u327E\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFFA0-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/u;\n\n// Check whether two UTF-16 code units form a surrogate pair\nconst isSurrogatePair = (c1: number, c2: number): boolean =>\n c1 >= 0xd800 && c1 <= 0xdbff && c2 >= 0xdc00 && c2 <= 0xdfff;\n\n// Check whether a character belongs to the Hangul script\nconst isHangul = (char: string): boolean => HANGUL_RE.test(char);\n\n// Check whether a character has a fullwidth (F), wide (W) or halfwidth (H) East Asian Width\nconst isFwh = (char: string): boolean => {\n // oxlint-disable-next-line typescript/no-non-null-assertion\n const eastAsianWidth = eastAsianWidthType(char.codePointAt(0)!);\n\n return (\n eastAsianWidth === \"fullwidth\" || eastAsianWidth === \"wide\" || eastAsianWidth === \"halfwidth\"\n );\n};\n\n/**\n * Remove soft breaks that cannot be converted to spaces.\n *\n * 移除无法转换为空格的软换行。\n *\n * This is an internal helper exported for tests only; use the `cjkBreaks` plugin instead.\n *\n * 这是仅为测试而导出的内部函数,请使用 `cjkBreaks` 插件。\n *\n * @param tokens - Inline token children / 行内 token 子节点\n */\nexport const processInlines = (tokens: Token[]): void => {\n for (let index = 0; index < tokens.length; index++) {\n const token = tokens[index];\n\n if (token.type !== \"softbreak\") continue;\n\n // default last/next character to space\n let last = SPACE;\n let next = SPACE;\n\n for (let cursor = index - 1; cursor >= 0; cursor--) {\n const previousToken = tokens[cursor];\n\n if (previousToken.type !== \"text\") continue;\n if (previousToken.content.length === 0) break;\n\n const c1 = previousToken.content.charCodeAt(previousToken.content.length - 2);\n const c2 = previousToken.content.charCodeAt(previousToken.content.length - 1);\n\n last = previousToken.content.slice(isSurrogatePair(c1, c2) ? -2 : -1);\n break;\n }\n\n for (let cursor = index + 1; cursor < tokens.length; cursor++) {\n const nextToken = tokens[cursor];\n\n if (nextToken.type !== \"text\") continue;\n if (nextToken.content.length === 0) break;\n\n const c1 = nextToken.content.charCodeAt(0);\n const c2 = nextToken.content.charCodeAt(1);\n\n next = nextToken.content.slice(0, isSurrogatePair(c1, c2) ? 2 : 1);\n break;\n }\n\n let removeBreak = false;\n\n // remove newline if it's adjacent to ZWSP\n if (last === ZWSP || next === ZWSP) removeBreak = true;\n\n // remove newline if both characters are fullwidth (F), wide (W) or\n // halfwidth (H), but not Hangul\n if (isFwh(last) && isFwh(next) && !isHangul(last) && !isHangul(next)) removeBreak = true;\n\n if (removeBreak) {\n token.type = \"text\";\n token.content = \"\";\n }\n }\n};\n\n// Core rule rewriting soft breaks between East Asian characters\nconst cjkBreaksRule: CoreRule = (state) => {\n for (let blockIndex = state.tokens.length - 1; blockIndex >= 0; blockIndex--) {\n const blockToken = state.tokens[blockIndex];\n\n if (blockToken.type !== \"inline\") continue;\n\n // oxlint-disable-next-line typescript/no-non-null-assertion\n processInlines(blockToken.children!);\n }\n};\n\nexport const cjkBreaks: PluginSimple = (md) => {\n if (hasRule(md, \"cjk_breaks\", \"core\")) return;\n\n md.core.ruler.push(\"cjk_breaks\", cjkBreaksRule);\n};\n"],"mappings":"A,iGAcA,MAWMA,EACJ,2LAGIC,GAAmB,EAAY,IACnCC,GAAM,OAAUA,GAAM,OAAUC,GAAM,OAAUA,GAAM,MAGlDC,EAAY,GAA0BJ,EAAU,KAAKK,CAAI,EAGzDC,EAAS,GAA0B,CAEvC,IAAMC,EAAiBC,EAAmBH,EAAK,YAAY,CAAC,CAAE,EAE9D,OACEE,IAAmB,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,CAC5E,IAAME,EAAaD,EAAM,OAAOD,GAE5BE,EAAW,OAAS,UAGxBb,EAAea,EAAW,QAAS,CACrC,CACF,EAEaC,EAA2B,GAAO,CACzCC,EAAQC,EAAI,aAAc,MAAM,GAEpCA,EAAG,KAAK,MAAM,KAAK,aAAcN,CAAa,CAChD,E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdit/plugin-cjk-breaks",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "CJK line-break plugin for MarkdownIt",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cjk",
|
|
7
|
+
"line-break",
|
|
8
|
+
"markdown-it",
|
|
9
|
+
"markdown-it-plugin"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://mdit-plugins.github.io/cjk-breaks.html",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/mdit-plugins/mdit-plugins/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Mr.Hope",
|
|
18
|
+
"email": "mister-hope@outlook.com",
|
|
19
|
+
"url": "https://mister-hope.com"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/mdit-plugins/mdit-plugins.git",
|
|
24
|
+
"directory": "packages/plugin-cjk-breaks"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"type": "module",
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"unpkg": "./dist/cdn.umd.js",
|
|
32
|
+
"jsdelivr": "./dist/cdn.umd.js",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"default": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsdown",
|
|
45
|
+
"clean": "rimraf ./dist"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@mdit/helper": "^1.2.1",
|
|
49
|
+
"get-east-asian-width": "^1.7.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"markdown-it": "^15.0.3"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"markdown-it": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=22"
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "cb814cb40a5d92c7e5525ab6a4bc25116f02a619"
|
|
63
|
+
}
|