react-native-html-to-markdown-for-tentap-editor

1.0.2 • Public • Published

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

  1. h1,h2,h3,h4,h5,h6
  2. p
  3. ul,ol
  4. blockquote,
  5. pre
  6. bold,strong
  7. italic,em
  8. a
  9. 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
})

Package Sidebar

Install

npm i react-native-html-to-markdown-for-tentap-editor

Weekly Downloads

17

Version

1.0.2

License

MIT

Unpacked Size

12.5 kB

Total Files

9

Last publish

Collaborators

  • terran_fenrir