mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
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:
+1
-1
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user