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:
WizardMeow 2024-11-21 07:12:10 +08:00 committed by GitHub
parent 44081dd3b1
commit fd015f147d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -243,7 +243,7 @@ const br = /^( {2,}|\\)\n(?!\s*$)/;
const inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
// 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')
.replace(/punctuation/g, _punctuation).getRegex();