Skip to content

Commit

Permalink
Add Unicode marks to default word boundary chars
Browse files Browse the repository at this point in the history
  • Loading branch information
slevithan committed Nov 21, 2024
1 parent 61687c2 commit c12afb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const FirstPassVisitor = {
} else if (kind === AstAssertionKinds.string_end_newline) {
replaceWith(parseFragment(r`(?=\n?\z)`));
} else if (kind === AstAssertionKinds.word_boundary && !wordIsAscii) {
const wordChar = r`[\p{L}\p{N}\p{Pc}]`;
const wordChar = r`[\p{L}\p{M}\p{N}\p{Pc}]`;
const b = `(?:(?<=${wordChar})(?!${wordChar})|(?<!${wordChar})(?=${wordChar}))`;
const B = `(?:(?<=${wordChar})(?=${wordChar})|(?<!${wordChar})(?!${wordChar}))`;
replaceWith(parseFragment(negate ? B : b));
Expand Down

0 comments on commit c12afb1

Please sign in to comment.