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

Replace setInnerHTML with Danger.dangerouslyUpdateInnerHTML, uses createNodesFromMarkup #2340

Closed
wants to merge 1 commit into from

Conversation

syranide
Copy link
Contributor

Related issue: #2273, fixes: #2247 (replaces #2249)

setInnerHTML and createNodesFromMarkup are two separate solutions to solve (largely) the same problem. createNodesFromMarkup solves more edge-cases. This PR replaces the guts of setInnerHTML with createNodesFromMarkup instead and moves setInnerHTML into Danger.dangerouslyUpdateInnerHTML where it belongs.

If we want to optimize performance then createNodesFormMarkup seems to have few things that could be optimized. We could also use innerHTML directly for browsers that don't fail the whitespace test or doesn't have issues with innerHTML for certain tags (but this should probably be incorporated into createNodesFromMarkup for best result instead).

  • Test plan: npm test
  • Make doubly-sure everything still works as it should in IE8

A test now fails because of yet another case of JSDOM being too strict/buggy, issue: #3146.

@syranide syranide changed the title Change setInnerHTML to use createNodesFromMarkup Replace setInnerHTML with Danger.dangerouslyUpdateInnerHTML, uses createNodesFromMarkup Oct 14, 2014
@sophiebits
Copy link
Collaborator

We're moving away from HTML except for server rendering so this is moot.

@sophiebits sophiebits closed this Nov 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minified version broken in IE8
4 participants