Thanks for all the great work.
The repo describes showdown as "A bidirectional MD to HTML to MD converter written in Javascript ", but I can't find how to convert HTML to MD. Is this supported? I can't seem to find it in the documentation.
Thank you!
HTML to MD converter is a new feature, available only in master branch. The documentation hasn't been written yet.
To use it you can clone the master branch and use converter.makeMarkdown(htmlText)
@tivie After cloning a master brach I get a Module not found: Error: Can't resolve 'tls' in [...]/node_modules/tunnel-agent error. Any clues?
@maciej-kolodziejczak cd into the showdown directory and npm install. this cleared up those errors for me.
Okay I just ran into this, How exactly to I use this to convert html to markdown? npm link or something?
@tivie solved this in https://github.com/showdownjs/showdown/commit/e4b0e697243f2d8b0a604eb688d08938a0e7acbb (issue closed here https://github.com/showdownjs/showdown/issues/233#event-1958639417)
and this issue can probably also be closed.
Is there a way to use this in Node.js, as this seems to be using the window object?
I am late here but with an answer:
const converter = new showdown.Converter();
// To HTML from Markdown:
converter.makeHtml(__YOUR_MARKDOWN)
// To Markdown from HTML:
converter.makeMarkdown(__YOUR_HTML)
Most helpful comment
Is there a way to use this in Node.js, as this seems to be using the window object?