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

What is the correct way to HTML Symbols? #149

Closed
codingedgar opened this issue Aug 21, 2022 · 2 comments
Closed

What is the correct way to HTML Symbols? #149

codingedgar opened this issue Aug 21, 2022 · 2 comments

Comments

@codingedgar
Copy link

Thank you so much for this library, and sorry for bothering, I don't seem to find a way to do this

<p>I will display &larr;</p>
<p>I will display &#8592;</p>
<p>I will display &#x2190;</p>

when I use DOM.text "&#8592;" it gets sanitized as &amp#8592;, for react it would be something like:

<p>I will display {&#x2190;}</p>

but I also don't know how to do {}

Tried with DOM.unsafeCreateDOMComponent "&#8593;" >>= React.element but it needs an actual component like p and I just want to write "&#8593;" escaped.

What is the correct way to do it?

@pete-murphy
Copy link
Member

You should be able to do

R.text "I will display \x2190"

https://try.purescript.org/?gist=852f261fb3aefbf9f41d17c6a2ef4af8

@codingedgar
Copy link
Author

Thank you so much!

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

No branches or pull requests

2 participants