draft-js-bbcode-converter

0.1.8 • Public • Published

DraftJS: Convert to and from BBCode

This is a module for DraftJS that will convert BBCode to editor content and back.

Based on draft-js-import-element and draft-js-export-html

How to use

import converter from 'draft-js-bbcode-converter';

// import from bbcode
const contentState = converter.bbcodeImport('[p]Hello [b]world[/b][/p]')

// export to bbcode
const contentState = editorState.getCurrentContent();
const bbcodeString = converter.bbcodeExport(contentState);

Readme

Keywords

Package Sidebar

Install

npm i draft-js-bbcode-converter

Weekly Downloads

28

Version

0.1.8

License

none

Last publish

Collaborators

  • defreek