Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert HTML back to Markdown for editing in wmd

Tags:

markdown

wmd

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 the markdown like on stackoverflow. Now, is there a way I can store both? or is it reliable enough to simply convert the HTML back to markdown to show in the wmd editor?

Thanks!

like image 730
Ryan M Avatar asked Oct 24 '08 20:10

Ryan M


People also ask

Can I convert HTML to markdown?

cross-browser testing tools Just paste your HTML in the form below, press the Convert to Markdown button, and you'll get Markdown. Press a button – get Markdown. No ads, nonsense, or garbage.

How do you convert markup to markdown?

Two-step method: First, multiply the cost (this time it is the cost to buy the item from the company) by the rate to get the markdown amount. Second, subtract the markdown amount from the cost. 2. c−m=S c − m = S .


2 Answers

If you want to convert HTML to Markdown in batch, I can recommend Aaron Swartz’s html2text.py Python script with which you can just:

cat my.html | python html2text.py # outputs markdown

Edit 05/11/12: Nowadays I use Pandoc which is like a swiss-knife for text documents. Can convert html<>textile<>markdown<>epub<>pdf<>latex, etc.

like image 179
kvz Avatar answered Sep 29 '22 00:09

kvz


Look at the optionsExample.html in your WMD distribution. There's an option to send the result to the server as Markdown.

like image 33
Chris Jester-Young Avatar answered Sep 29 '22 01:09

Chris Jester-Young