1

Is there any way to transform HTML into Markdown text?

  • HTML is pretty simple - it's just a div element with several <p> elements inside.
  • There may be images - I want to preserve them as well.
  • Also, there may be several "inline" images like this one: <img src='images/symbol_minus.gif' width='9' height='3' alt='&minus;' border='0' style='vertical-align:middle;' /> which is just a minus sign - I want to replace them with text.

Nokogiri::XML::Element#text is almost something that I want, but it strips off images.

DNNX
  • 6,215
  • 2
  • 27
  • 33
  • Please see [this stackoverflow entry][1]. [1]: http://stackoverflow.com/questions/1751622/i-need-to-go-from-html-to-markdown-any-suggestion – Konrads Aug 18 '11 at 06:55
  • @Konrads, unfortunately, reverse-markdown is dead (github throws 404). Anyway, thank you for the suggestion. – DNNX Aug 18 '11 at 09:03

1 Answers1

3

As @Konrads suggested, there is a duplicate entry here. However, the link which is given in the answer on that entry is broken.

I've googled a bit more and found that some forks survived: https://github.com/tomkrush/reverse-markdown, https://gist.github.com/788039.

If these forks become dead, just google for "reverse markdown". You will definitely find something that is alive and working.

Community
  • 1
  • 1
DNNX
  • 6,215
  • 2
  • 27
  • 33