Skip to content

msadakov/draftjs-prism

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

draftjs-prism

NPM version

draftjs-prism is a decorator for DraftJS to highlight code blocks using Prism.

Prism

Installation

$ npm install draftjs-prism

Usage

var Draft = require('draft-js');
var PrismDecorator = require('draftjs-prism');

var decorator = new PrismDecorator();
var editorState = Draft.EditorState.createEmpty(decorator)

You'll also need to include the css for one of the Prism themes.

You can use this decorator combined with others by using draftjs-multidecorators

About

Code highlighting for DraftJS using Prism

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 81.0%
  • CSS 10.3%
  • HTML 8.7%