slux-sites-draftjs-export-html

Slux Sites: Fork of DraftJS Export ContentState to HTML

Usage no npm install needed!

<script type="module">
  import sluxSitesDraftjsExportHtml from 'https://cdn.skypack.dev/slux-sites-draftjs-export-html';
</script>

README

Slux Sites: Fork of DraftJS Export ContentState to HTML

This is a module for DraftJS that will export your editor content to semantic HTML.

This project is forked from draft-js-export-html and improved for Slux Sites where needed. Follow documentation of draft-js-export-html for more information.

Installation

npm install --save draft-js-export-html

How to Use

import {stateToHTML} from 'draft-js-export-html';
let html = stateToHTML(contentState);

Changes in Fork

  • Atomic elements when empty got a &nbsp - this has been removed