Skip to content

Commit f5dd6bb

Browse files
committed
Updating readme
1 parent 601a484 commit f5dd6bb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# HTML To DraftJS
22

33
A library for converting to plain HTML DraftJS Editor content.
4-
Build for use with editor library react-draft-wysiwyg
4+
Build for use with editor library **[react-draft-wysiwyg](https://github.com/jpuri/react-draft-wysiwyg)**.
55

6-
## Installing
6+
## Installation
77

88
```
99
npm install html-to-draftjs --save
1010
```
1111

12-
## Using
12+
## Usage
1313
```
1414
import { EditorState, ContentState } from 'draft-js';
1515
import htmlToDraft from 'html-to-draftjs';
1616
1717
const blocksFromHtml = htmlToDraft(this.props.content);
18-
const contentBlocks = blocksFromHtml.contentBlocks;
19-
const contentState = ContentState.createFromBlockArray(contentBlocks);
18+
const { contentBlocks, entityMap } = blocksFromHtml.contentBlocks;
19+
const contentState = ContentState.createFromBlockArray(contentBlocks, entityMap);
2020
const editorState = EditorState.createWithContent(contentState);
2121
```

0 commit comments

Comments
 (0)