Skip to content

Conversation

@remarkablemark
Copy link
Owner

Summary:

HTML entities aren't decoded by default for htmlparser2 (initialized by html-dom-parser). As a result, this will lead to an Invariant Violation because the entities are decoded on the client-side.

The fix is to always set decodeEntities: true for htmlparser2.

Resolves #34.

Tasks:

  • Set parser options decodeEntities to true for html-dom-parser, which gets passed to htmlparser2
  • Write test to confirm that HTML entities passed to React element's children are properly decoded

Set parser options `decodeEntities` to true for `html-dom-parser`,
which gets passed to `htmlparser2`.

Write test to confirm that entities passed to React element's
children are decoded (but they will still be encoded when rendered
by ReactDOMServer).
@remarkablemark remarkablemark self-assigned this Jan 26, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 99.237% when pulling 68a5169 on decode-entities into 99870f3 on master.

@remarkablemark remarkablemark merged commit 1d6bf11 into master Jan 26, 2017
@remarkablemark remarkablemark deleted the decode-entities branch January 26, 2017 20:03
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.

Ability to pass options to htmlparser2

2 participants