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 dangerouslySetInnerHtml in GeneratedCode with UnsafeRenderedMarkdown #27695

Merged
merged 3 commits into from Mar 26, 2019

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Mar 25, 2019

Part of our overall dSIH deprecation effort

Also requires a styling change, since we're changing the .generatedCodeMessage element from a paragraph to a div.

@Hamms Hamms force-pushed the update-html-in-generatedcode branch from 55102b4 to 1d2e859 Compare March 25, 2019 23:57
@Hamms Hamms requested a review from islemaster March 25, 2019 23:58
/>
<pre className="generatedCode" dir="ltr">
{this.props.code}
</pre>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it this dangerouslySetInnerHTML was never needed for props.code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, that's correct! The content in here comes from codegen, which never uses html characters.

Which also makes sense; there's no reason to dangerouslySetInnerHTML on a pre tag, since it would just be ignored anyway.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@Hamms Hamms merged commit ed526d9 into staging Mar 26, 2019
@Hamms Hamms deleted the update-html-in-generatedcode branch March 26, 2019 18:30
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.

None yet

2 participants