fix: update punctuation regex syntax for compatibility (#3540)
change the string to a regular expression. Then babel can transpile it correctly.
This commit is contained in:
parent
44081dd3b1
commit
fd015f147d
@ -243,7 +243,7 @@ const br = /^( {2,}|\\)\n(?!\s*$)/;
|
|||||||
const inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
const inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
||||||
|
|
||||||
// list of unicode punctuation marks, plus any missing characters from CommonMark spec
|
// list of unicode punctuation marks, plus any missing characters from CommonMark spec
|
||||||
const _punctuation = '\\p{P}\\p{S}';
|
const _punctuation = /\p{P}\p{S}/u;
|
||||||
const punctuation = edit(/^((?![*_])[\spunctuation])/, 'u')
|
const punctuation = edit(/^((?![*_])[\spunctuation])/, 'u')
|
||||||
.replace(/punctuation/g, _punctuation).getRegex();
|
.replace(/punctuation/g, _punctuation).getRegex();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user