Closed bootstraponline closed 12 years ago
Perhaps you are confused what this library is designed to do - it converts an existing DOM structure into markdown, not the other way around. If you want to convert markdown into DOM, you should look at another lib, like https://github.com/chjj/marked/
Thanks for your response. I was passing in a string of HTML to convert to markdown instead of a DOM element.
This gave me a good idea, I should allow an html-string to be passed into reMarked.js and set that as the innerHtml
of a dummy div
to quickly parse it and produce the same markdown output. Low effort, high reward. Maybe a 3-liner patch tonight :D
That'd be amazing.
I tested out the change and it's so much better than what I was using before. The code examples now translate properly.
The only missing feature is GitHub Flavored Markdown tables as seen in example.md.
interesting. i haven't touched this project for a few months and they must have added a few more GFM features, including tables and some other stuff that wasn't there before: https://raw.github.com/suan/github-flavored-markdown-test/master/README.md
i was using this one for testing/reference previously: https://raw.github.com/mojombo/github-flavored-markdown/gh-pages/_site/sample_content.md http://github.github.com/github-flavored-markdown/sample_content.html
the tables look pretty quick to implement, i'll add them over the weekend.
One aspect of tables that's not in those links is omitting leading pipes.
cool, thanks. do you have a link to the actual spec for this, or some official test markdown and output html samples? please link them under issue #12
The spec is from PHP Markdown Extra. I've added a link to #12.
Attempting to convert example.md produces many JavaScript errors. I've tried patching the library a bit, however it just uncovers more problems.