Closed oztek22 closed 6 years ago
Support for dangerouslySetInnerHTML
was intentionally left out since it's, you know, dangerous.
If you have text that contains HTML tags that you also want to linkify, you can do so by first running it through dangerouslySetInnerHTML
, and then using Linkify
on the result. For example:
<Linkify>
<span dangerouslySetInnerHTML={{__html: text}}></span>
</Linkify>
@tasti not sure why, but that actually doesn't work.
I have this:
<Linkify>
<p className="col-md-7" dangerouslySetInnerHTML={{ __html: description }} />
</Linkify>
And it renders:
<span class="Linkify">
<p class="col-md-7">
<p>blablabla https://google.com google.com asdasd</p>
</p>
</span>
The content of decription
is: <p>blablabla https://google.com google.com asdasd</p>
this issue should not be closed, this ticket still valid IMO
In render of Linkify.jsx, you can replace return code with this line to add supports to HTML tags.
<span className={this.props.className} dangerouslySetInnerHTML={{ __html: parsedChildren }}></span>