Convert HTML back to Markdown for editing in wmd

前端 未结 5 2097
抹茶落季
抹茶落季 2020-12-05 15:04

I am curious to do what happens when you edit a post on this site.

I am using wmd for my markdown editor, of course when I goto edit, I get the HTML it generated not

5条回答
  •  -上瘾入骨i
    2020-12-05 15:40

    As Chris notes, you can send Markdown to the server so you can store it there as such. I started trying to use MarkdownJ to convert on the server-side, but it doesn't (at the time of this writing) convert images to HTML correctly and so I ended up going with Java 6 Scripting: Rhino engine + showdown.js. Since WMD uses showdown.js you get the same Markdown-to-HTML transformation. Works like a charm (for Java 6, anyway).

提交回复
热议问题