@jacobbubu/md-to-lark 1.4.6 → 1.4.7
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const CJK_BOLD_TRAILING_PUNCTUATION = ',。;:!?、】【)」』》、';
|
|
2
|
-
const BOLD_PUNCTUATION_RE = new RegExp(
|
|
2
|
+
const BOLD_PUNCTUATION_RE = new RegExp(`(^|[^\\p{Script=Han}\\p{Letter}\\p{Number}*])(\\*\\*([^*\\n]+?)([${CJK_BOLD_TRAILING_PUNCTUATION}])\\*\\*)(?=[\\p{Script=Han}\\p{Letter}\\p{Number}\\[])`, 'gu');
|
|
3
3
|
function transformOutsideInlineCode(segment) {
|
|
4
|
-
return segment.replace(BOLD_PUNCTUATION_RE, (_match, content, punctuation) => {
|
|
5
|
-
return
|
|
4
|
+
return segment.replace(BOLD_PUNCTUATION_RE, (_match, prefix, _fullBold, content, punctuation) => {
|
|
5
|
+
return `${prefix}**${content}**${punctuation}`;
|
|
6
6
|
});
|
|
7
7
|
}
|
|
8
8
|
function normalizeLineOutsideInlineCode(line) {
|