Skip to content

fix(remark-rfc2119): add word boundaries and skip spliced nodes (issue: #1684)#1685

Open
Emeenent14 wants to merge 1 commit intojson-schema-org:mainfrom
Emeenent14:fix/remark-rfc2119-visitor-and-regex
Open

fix(remark-rfc2119): add word boundaries and skip spliced nodes (issue: #1684)#1685
Emeenent14 wants to merge 1 commit intojson-schema-org:mainfrom
Emeenent14:fix/remark-rfc2119-visitor-and-regex

Conversation

@Emeenent14
Copy link

  • Add \b word boundary assertions to KEYWORD_REGEX to prevent matching keywords inside other words (e.g. MUST in EXHAUST, MAY in MAYHEM)

  • Import SKIP from unist-util-visit and return [SKIP, index + children.length] after splicing to prevent re-visiting newly inserted nodes

closes #1684

- Add \b word boundary assertions to KEYWORD_REGEX to prevent matching keywords inside other words (e.g. MUST in EXHAUST, MAY in MAYHEM)

- Import SKIP from unist-util-visit and return [SKIP, index + children.length] after splicing to prevent re-visiting newly inserted nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: remark-rfc2119: visitor re-processes spliced nodes + regex matches keywords inside words

1 participant