Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lossen attribute and reference regex, validate later #13

Merged
merged 1 commit into from
May 2, 2020

Conversation

rossj
Copy link
Contributor

@rossj rossj commented May 1, 2020

This is a potential fix for #12, with all tests passing.

I tried various updates to the Attribute regex that would still include the Reference regex while avoiding the RangeError, but I was unable to avoid either a "hang" (catastrophic backtracking) or the RangeError, so I went with a different approach.

Here's what I've done

  • Remove the Reference regex from the Attribute regex, and instead just allow all & characters (references validated later)
  • Further loosen the Reference regex to capture any &... with an additional check added in replaceReference

@rgrove rgrove merged commit 6f8d182 into rgrove:master May 2, 2020
@rgrove
Copy link
Owner

rgrove commented May 2, 2020

Thanks!

@rgrove rgrove linked an issue May 2, 2020 that may be closed by this pull request
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.

RegExp issue with very long attributes
2 participants