<commit_before># draftjs-prism

[![Build Status](https://travis-ci.org/SamyPesse/draftjs-prism.png?branch=master)](https://travis-ci.org/SamyPesse/draftjs-prism)
[![NPM version](https://badge.fury.io/js/draftjs-prism.svg)](http://badge.fury.io/js/draftjs-prism)

`draftjs-prism` is a decorator for DraftJS to highlight code blocks using [Prism](https://github.com/PrismJS/prism).

![Prism](./preview.gif)

### Installation

```
$ npm install draftjs-prism
```

### Usage

```js
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](https://github.com/PrismJS/prism/tree/gh-pages/themes).<commit_msg>Add text about draftjs-multidecorators<commit_after># draftjs-prism

[![NPM version](https://badge.fury.io/js/draftjs-prism.svg)](http://badge.fury.io/js/draftjs-prism)

`draftjs-prism` is a decorator for DraftJS to highlight code blocks using [Prism](https://github.com/PrismJS/prism).

![Prism](./preview.gif)

### Installation

```
$ npm install draftjs-prism
```

### Usage

```js
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](https://github.com/PrismJS/prism/tree/gh-pages/themes).

You can use this decorator combined with others by using [draftjs-multidecorators](https://github.com/SamyPesse/draftjs-multidecorators)

{'fraction_non_alphanumeric': 0.16337854500616522, 'fraction_numerical': 0.0, 'mean_word_length': 5.290697674418604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3328015', 'n_tokens_mistral': 595, 'n_tokens_neox': 567, 'n_words': 113}