react-native-html-to-markdown-for-tentap-editor
v1.0.3
Published
html to markdown converter compatible with react-native
Downloads
110
Maintainers
Readme
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 :)
React-Native Html to markdown converter
A simple html to markdown converter that converts html to markdown, using no dependencies. Perfect for react-native.
Tags Supported
- h1,h2,h3,h4,h5,h6
- p
- ul,ol
- blockquote,
- pre
- bold,strong
- italic,em
- a
- br
Converting Html Documents
var converter = require('html-to-markdown');
var markdown = converter.convert('<h2> Happy Journey </h2>');
Extending to add your own formatters.
var converter = require('html-to-markdown');
converter.use(function (html) {
// making required changes
// and return new html
})