Closed truongnmt closed 4 years ago
Hi @truongnmt,
Text of toast message is HTML friendly, so you can use it in both ways without any additional implementation.
Toastify({
text: 'Looks at this nice image <img src="#">'
});
WOw! I don't know that! Thanks!
Looks like we can just pass HTML into the text
attribute and it renders as HTML:
https://github.com/apvarun/toastify-js/blob/ccacb7e87295e73c5e2c2717cb1f6635b78c9a1a/src/toastify.js#L102
This sounds like a security issue.
A breaking change would be text
would modify innerText and we could simply have another option for html
to modify the innerHTML. I know there's a node
options but this is simpler to use when we trust or already sanitized the contents.
First, thanks for an awesome library!
I have a use case that I want to display a structured HTML in a toast message, not just plain text, I want to display an image and some styled text as well.
Wonder if I could do the above behavior with some options such as