Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Differences in escaped/encoded text between React and Rapscallion #57

Closed
bmathews opened this issue Mar 3, 2017 · 2 comments
Closed
Labels

Comments

@bmathews
Copy link
Contributor

bmathews commented Mar 3, 2017

This test fails due to differences in encoding charcode 39 between React and Rapscallion.

describe("text encoding", () => {
  const Component = () => <div>{"<script type='' src=\"\"></script>"}</div>;
  checkParity(Component, {});
});

We can either pull in react-dom/lib/escapeTextContentForBrowser as a dep and use it directly, or duplicate/copy the changes necessary for parity.

https://github.com/facebook/react/blob/master/src/renderers/dom/shared/escapeTextContentForBrowser.js

@divmain divmain added the bug label Mar 3, 2017
@aweary
Copy link
Contributor

aweary commented Mar 3, 2017

We should probably just copy it directly and maintain our own version of it. Future releases of React may not expose internal modules under react{-dom}/lib/*

@divmain
Copy link
Contributor

divmain commented Mar 4, 2017

Agreed. @bmathews, feel free to open another PR, and include the test above if possible. And thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants