Skip to content

Commit fd015f1

Browse files
authoredNov 20, 2024··
fix: update punctuation regex syntax for compatibility (#3540)
change the string to a regular expression. Then babel can transpile it correctly.
1 parent 44081dd commit fd015f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/rules.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ const br = /^( {2,}|\\)\n(?!\s*$)/;
243243
const inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
244244

245245
// list of unicode punctuation marks, plus any missing characters from CommonMark spec
246-
const _punctuation = '\\p{P}\\p{S}';
246+
const _punctuation = /\p{P}\p{S}/u;
247247
const punctuation = edit(/^((?![*_])[\spunctuation])/, 'u')
248248
.replace(/punctuation/g, _punctuation).getRegex();
249249

0 commit comments

Comments
 (0)
Please sign in to comment.