Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rkpasia/draft-js-exporter

A module to export and format the content from the React Draft.js framework.
https://github.com/rkpasia/draft-js-exporter

Last synced: 26 days ago
JSON representation

A module to export and format the content from the React Draft.js framework.

Awesome Lists containing this project

README

        

# draft-js-exporter
A module to export and format the content from the React Draft.js framework.

**NOT YET ON npm coming soon**

This is an early version of an export module.
The goal is to provide a modular structure to select the format to export.

Actually there is an early HTML formatter that support `BOLD` and `ITALIC` inline styles.
It automatically wraps the block inside a `p` element if the `type` of the block is `unstyled`.

# Install
`npm i draft-js-exporter`

# Usage

````
var DraftExporter = require('draft-js-exporter');


var rawDraftContentBlock = Draft.convertToRaw(contentState);
var exporter = new DraftExporter(rawDraftContertBlock);
var contentExported = exporter.export();

````