@jacobbubu/md-to-lark 1.4.8 → 1.4.9
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.
|
@@ -2,7 +2,7 @@ import { unified } from 'unified';
|
|
|
2
2
|
import remarkParse from 'remark-parse';
|
|
3
3
|
const CJK_BOLD_TRAILING_PUNCTUATION = new Set([',', '。', ';', ':', '!', '?', '、', ')', '》', '】', '」', '』']);
|
|
4
4
|
const NORMALIZATION_NEXT_CHAR_RE = /[\p{Script=Han}\p{Letter}\p{Number}\[]/u;
|
|
5
|
-
const PROTECTED_NODE_TYPES = new Set(['code', 'inlineCode', '
|
|
5
|
+
const PROTECTED_NODE_TYPES = new Set(['code', 'inlineCode', 'html']);
|
|
6
6
|
function mergeProtectedRanges(ranges) {
|
|
7
7
|
const sorted = [...ranges].sort((a, b) => a.start - b.start || a.end - b.end);
|
|
8
8
|
const merged = [];
|
|
@@ -53,6 +53,11 @@ function collectCjkBoldNormalizationEdits(segment, baseOffset) {
|
|
|
53
53
|
cursor = open + 2;
|
|
54
54
|
continue;
|
|
55
55
|
}
|
|
56
|
+
const firstContentChar = segment[open + 2] ?? '';
|
|
57
|
+
if (!firstContentChar || /\s/u.test(firstContentChar)) {
|
|
58
|
+
cursor = open + 2;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
56
61
|
let closeSearch = open + 2;
|
|
57
62
|
let matched = false;
|
|
58
63
|
while (closeSearch < segment.length - 1) {
|
|
@@ -63,6 +68,10 @@ function collectCjkBoldNormalizationEdits(segment, baseOffset) {
|
|
|
63
68
|
if (rawContent.includes('\n')) {
|
|
64
69
|
break;
|
|
65
70
|
}
|
|
71
|
+
if (rawContent.includes('**')) {
|
|
72
|
+
closeSearch = close + 2;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
66
75
|
const punctuation = segment[close - 1] ?? '';
|
|
67
76
|
const content = segment.slice(open + 2, close - 1);
|
|
68
77
|
const nextChar = segment[close + 2] ?? '';
|