I've been trying to create a client side editor which allows the end user to create content in html or markdown. The user has two tabs for switching between the two. I managed to find some javascript that converts markdown to html, so if a user has been writing markdown and switches to the html tab, the html equivilant is shown. I haven't been able to find a javascript that converts html to markdown, only a python script.
The python script is obviously server side. The tabs are just hyperlinks with script in there. Is there any way I can convert the markdown html when the user clicks the tab?
The currently accepted answer actually tells you to do it on the server-side.
To really do client-side conversion, you could try one of these libraries (in order of popularity, measured by GitHub stars):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With