DownmarkIt is a library to convert HTML to markdown, based on Hpricot.
While working on our company's new CMS, I needed to parse HTML back to markdown and surprisngly there wasn't any solution that could fit our enviroment, so I decided to make my own and share it :)
Make sure you install Hpricot first, then require the library in your application, if you are using the library in a rails application, just place it in your lib folder, then use this method to convert HTML into markdown. markdown = DownmarkIt.to_markdown(html)
This library supports variable header tags, horizontal rulers, emphasis, strong, links, images, blockqoutes, code, unordered lists(nested) and ordered lists(nested)
Currently DownmarkIt does not support ul tags inside ol tags or vice versa, maybe in the future i will add it ;)
This code is licensed under MIT License