Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/rkpasia/draft-js-exporter
- Owner: rkpasia
- License: mit
- Created: 2016-03-09T16:35:46.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-21T20:49:06.000Z (about 8 years ago)
- Last Synced: 2024-11-09T16:04:55.775Z (about 1 month ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 34
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-draft-js - Draft.js Exporter - Export and format the content from Draft.js. (Common Utilities)
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();
````