ProseToHTML
A library for converting ProseMirror Editor content to plain HTML.
Installation
npm i prosemirror-to-html-sync
Usage
const ProseToHTML = ; // Pass in the JSON data received from the ProseMirror EditorProseToHTML);
ProseToHTML
instance can take in following properties:
A types
: List of type handlersmarks
: List of mark handlersverbose
: Boolean, debug output (true or false)
and has access to the following functions:
toHTML(object)
:
- returns:
initProseMark(string, function)
:
-
initProseEntity(string, function)
:
-
It is important to note that initProseEntity()
or initProseMark()
overwrite default values, thus easy to adapt!
Test
To test it, just run the test
script.
License
MIT.