I am using WMD editor. This one.
It is working fine. But issue is, i want to get it working with edit form.
Right now i am getting html instead of markdown text. My code is like following in my edit page.
<div id="wmd-editor" class="wmd-panel">
<div id="wmd-button-bar"></div>
<textarea id="wmd-input"><?php echo $row['description']?></textarea>
</div>
<div id="wmd-preview" class="wmd-panel"></div>
<div id="wmd-output" class="wmd-panel"></div>
Not sure what is wrong here.
First off: the repository is not maintained (and apparently has not been updated for over 7 years) so you should consider switching to an active branch. WMD was renamed to
Page Downbut there are many alternative editors out there you can use.As timclutton commented you are probably storing HTML in your database. WMD does not support conversion from HTML to Markdown. So the best solution would be to store the content as Markdown.
To do this change your create page. Since I have no code I'll just give you an example on how it could look:
Server-side you can now store the content of
$_POST['content']in your database and later output it exactly the way you are doing it right now to the edit page.Lastly a security note from the Page Down wiki: