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

Content of <Helmet> should always be trusted #59

Closed
2 tasks done
yandeu opened this issue Nov 20, 2021 · 4 comments
Closed
2 tasks done

Content of <Helmet> should always be trusted #59

yandeu opened this issue Nov 20, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@yandeu
Copy link
Member

yandeu commented Nov 20, 2021

See #57

(FYI, withStyles() uses <Helmet /> under the hood.)

@yandeu yandeu added the bug Something isn't working label Nov 20, 2021
@Shinyaigeek
Copy link
Contributor

Shinyaigeek commented Nov 20, 2021

Oh, I’m sorry. #44 This PR maybe causes this issue 🙇. I want to fix this issue, but I’m worried about under what conditions to trust(= not escape text node).

I think that if text node is descendants of <Helmet /> or child of <style /> or <script /> we should not escape text node. What do you think about this?

@yandeu
Copy link
Member Author

yandeu commented Nov 20, 2021

Thanks for your help. I'm already about to fix it :)

I think everything under <Helmet /> should not be escaped.
In addition noscript, script', style elements should also never be auto-escaped.

This behavior should be clear in the docs as well.

Check https://github.com/nanojsx/nano/compare/fix-helmet-ssr

@Shinyaigeek
Copy link
Contributor

Shinyaigeek commented Nov 20, 2021

Oh! Nice 👍 Looks good, Thanks 🙏

nanojsx/nanojsx.github.io#3

Should we describe this behavior in the dangerouslySetInnerHTML part of the Docs (added in the above PR)? if you think so, I want to work on this.

@yandeu yandeu closed this as completed in 2da91ed Nov 20, 2021
@yandeu yandeu reopened this Nov 20, 2021
@yandeu
Copy link
Member Author

yandeu commented Nov 20, 2021

Should we describe this behavior in the dangerouslySetInnerHTML part of the Docs (added in the above PR)? if you think so, I want to work on this.

👍

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

No branches or pull requests

2 participants