I have a website like stackoverflow. There is a textarea which people write answers. I use this PHP library to convert markdown. I mean I use that function to convert *italic*
to <i>italic</i>
.
// include that library
$Parsedown = new Parsedown();
echo $Parsedown->text('*italic*'); # prints: <i>italic</i>
Well All fine. It should be noted I convert that answer (to html tags, not markdown symbols) befor storing, in other word, all data in the database are containing HTML tags, not markdown symbols.
Now I want to implement Editing-System for answers. Something exactly like stackoverflow. So I need to convert saved answer to markdown-style again.
Now I want to know, how can I reconvert it? I mean I want to convert <i>italic</i>
to *italic*
, How can I do that?