mirror of
https://github.com/markedjs/marked
synced 2024-11-23 09:48:17 +00: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:
parent
44081dd3b1
commit
fd015f147d
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user