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

How to use unsafe html ? #2

Open
asafyish opened this issue Oct 14, 2015 · 2 comments
Open

How to use unsafe html ? #2

asafyish opened this issue Oct 14, 2015 · 2 comments

Comments

@asafyish
Copy link

In react we can use

<div dangerouslySetInnerHTML={{__html: 'unsafe content'}} />

is there any way to do it using jsx-to-idom ?

Great plugin btw !

@NekR
Copy link
Member

NekR commented Oct 14, 2015

Hi @asafyish, I am currently working on v2 for jsx-runtime and related renderers (jsx-to-*) and v2 will have this feature. Unfortunately current version does not have it.

I imagine it to work this way:

<div>
  <span>Safe content</span>
  { new HTMLString('<i>Unsafe content</i>') }
  <span>Safe content</span>
<div>

Of course it could be just <div>{ new HTMLString('...') }</div>.

Anyway, this is just a pseudo code at the moment, but I hope to have v2 soon.

@asafyish
Copy link
Author

Thanks !

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