Search code examples
htmlwysiwyg

How to convert STRING (WYSIWYG) into HTML?


Hello!

I have string with WYSWIG syntax like this:

# This is h1
#### This is h4

**bold text**
*italic text*
__underlined text__

And i want to convert it to normal html tags (<b>bold</b> instead of **bold**).


Do you know how can I do it?

Thanks in advance!


Solution

  • OK, solved - there is a library called react-markdown, which converts WYSIWYG into react components.