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

Fix regex bug on client parser #24

Merged
merged 2 commits into from Sep 27, 2016
Merged

Fix regex bug on client parser #24

merged 2 commits into from Sep 27, 2016

Conversation

remarkablemark
Copy link
Owner

Fixes #23

Tasks:

  • Fix regex so that only the tag name is matched for the client parser before being parsed by window.DOMParser
  • Add test to ensure client parser does not break on regex and DOMParser

For the client parser, when the first element of the HTML string
has attributes, the regex will improperly capture everything and
make the tag name invalid.

The fix is to ensure only the tag name is matched and whitespace
is trimmed.

Fixes #23
Confirm that for the client parser, if the first HTML element has
attributes, it should properly match only the tag name and no
longer throw an error.

Issue #23
@remarkablemark remarkablemark added the bug Something isn't working label Sep 27, 2016
@remarkablemark remarkablemark self-assigned this Sep 27, 2016
@coveralls
Copy link

Coverage Status

Coverage increased (+3.08%) to 97.949% when pulling 1bd17dd on bug-client-parser into 646b4a8 on master.

@remarkablemark remarkablemark merged commit 0bc51e0 into master Sep 27, 2016
@remarkablemark remarkablemark deleted the bug-client-parser branch September 27, 2016 15:58
remarkablemark added a commit that referenced this pull request Sep 27, 2016
- Update README (#17 and #21):
  - Improve documentation of `replace` option with the help of
    @poacher2k
  - Tidy and reword some parts
- Use webpack to build UMD bundle (#22)
  - Build to `./dist/` directory before publish
- Fix regex bug on client parser (#24)
  - Add test for `window.DOMParser`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants