Skip to content

Commit

Permalink
fix: update punctuation regex syntax for compatibility (#3540)
Browse files Browse the repository at this point in the history
change the string to a regular expression. Then babel can transpile it correctly.
  • Loading branch information
BlueCat0 authored Nov 20, 2024
1 parent 44081dd commit fd015f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit fd015f1

Please sign in to comment.