I have a website like stackoverflow for example. There is a text box in which people write answers. I use this PHP library to convert markdowns. I mean, I use this function to convert *italic*
to <i>italic</i>
.
// include that library $Parsedown = new Parsedown(); echo $Parsedown->text('*italic*');
Well, everything is fine. It should be noted that I convert this answer (to html tags, not markup characters) for storage, in other words, all the data in the database contains HTML tags, not markup characters.
Now I want to implement a Editorial system for answers. Something like stackoverflow. So I need to convert the saved answer back to markdown style again.
Now I want to know how I can convert it? I want to convert <i>italic</i>
to *italic*
, how can I do this?
source share