Skip to content

Commit de791f6

Browse files
committed
2 parents 130daca + 49e610d commit de791f6

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
#HTML to DraftJS
1+
# HTML To DraftJS
22

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

5-
## To setup
6-
- `yarn` or `npm install`
6+
## Installing
77

8-
## To start running playground
9-
- `npm start`
8+
```
9+
npm install html-to-draftjs --save
10+
```
1011

11-
## To build
12-
- `num run build`
12+
## Using
13+
```
14+
import htmlToDraft from 'html-to-draftjs';
15+
16+
const blocksFromHTML = htmlToDraft(this.props.content);
17+
const contentState = ContentState.createFromBlockArray(blocksFromHTML);
18+
const editorState = EditorState.createWithContent(contentState);
19+
```

0 commit comments

Comments
 (0)