This was forked from a github repo. I am using TenTap editor for a project. Unfortunately, TenTap editor outputs in HTML instead of markdown. This is why I had to use the original package. Now, I saw that it was a little bad for my use case. This is why I created this different repo quickly as I'm not sure if my edits will work for all HTML to markdown conversions. I have done this very quickly (and most likely very sloppily).
This works for my use case, but might not work for yours. If you can make contribs that expand the scope, you are more than more than welcome to do so :)
A simple html to markdown converter that converts html to markdown, using no dependencies. Perfect for react-native.
- h1,h2,h3,h4,h5,h6
- p
- ul,ol
- blockquote,
- pre
- bold,strong
- italic,em
- a
- br
var converter = require('html-to-markdown');
var markdown = converter.convert('<h2> Happy Journey </h2>');
var converter = require('html-to-markdown');
converter.use(function (html) {
// making required changes
// and return new html
})