This is not a duplicate question, i know how to create a rich editor, but i meet problems
I want to make a rich text box like stackoverflow does.
I import the wmd plugin just like SO.
When i save a topic to mysql, it saves the processed text like this:
< p>hello world< /p>
< pre >< code >class Text {} < /code >< /pre >
This is normal i think because the html page can render this correctly.
But When i try to edit this topic, it directly shows the code in my textarea:
What i need is this(Just like the first time i entered):
My textarea code is very simple like this:
<!-- text area start -->
<div id="wmd-button-bar"></div>
<textarea id="wmd-input" name="description" onblur="checkForm()">${topic?.description}</textarea>
<div id="wmd-preview"></div>
<!-- text area end -->
Anyone can help ? Thanks.