Skip to content

Fix regex bug on client parser#24

Merged
remarkablemark merged 2 commits intomasterfrom
bug-client-parser
Sep 27, 2016
Merged

Fix regex bug on client parser#24
remarkablemark merged 2 commits intomasterfrom
bug-client-parser

Conversation

@remarkablemark
Copy link
Copy Markdown
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
Copy Markdown

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.

2 participants