draft-to-html

parse draft js content state into html

Usage no npm install needed!

<script type="module">
  import draftToHtml from 'https://cdn.skypack.dev/draft-to-html';
</script>

README

draft-to-html

In progress

Usage:

import convertToHtml from 'draft-to-html'

...

convertToHtml(contentState, options)

Options:

{
  parseStyle: string => HTMLElement,
  parseEntity: (entity: {
    type: DraftEntityType,
    mutability: DraftEntityMutability,
    data: ?{[key: string]: any},
  }) => HTMLElement,
  parseBlock: ContentBlock => HTMLElement
}