Skip to content

Commit 5a5e6cf

Browse files
Reword README beginning
Make explanations/examples clearer, trim fat, and add hyperlinks.
1 parent 5601606 commit 5a5e6cf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
[![Coverage Status](https://coveralls.io/repos/github/remarkablemark/html-react-parser/badge.svg?branch=master)](https://coveralls.io/github/remarkablemark/html-react-parser?branch=master)
88
[![Dependency status](https://david-dm.org/remarkablemark/html-react-parser.svg)](https://david-dm.org/remarkablemark/html-react-parser)
99

10-
An HTML to React parser.
10+
An HTML to React parser:
1111

1212
```
1313
Parser(htmlString[, options])
1414
```
1515

16-
The parser converts an HTML string to [React element(s)](https://facebook.github.io/react/docs/glossary.html#react-elements). You can also `replace` element(s) with your own custom React element(s) via the parser options.
16+
The parser converts a string of HTML to [React Element(s)](https://facebook.github.io/react/docs/glossary.html#react-elements).
1717

18-
### Example
18+
There is also an option to [replace](#replacedomnode) element(s) with your own React Element(s) via the [parser options](#options).
19+
20+
#### Example
1921

2022
```js
2123
var Parser = require('html-react-parser');
22-
var reactElement = (
23-
Parser('<p>Hello, world!</p>') // same as `React.createElement('p', {}, 'Hello, world!')`
24-
);
25-
require('react-dom').render(reactElement, document.getElementById('root'));
24+
Parser('<p>Hello, world!</p>');
25+
// same output as `React.createElement('p', {}, 'Hello, world!')`
2626
```
2727

2828
## Installation

0 commit comments

Comments
 (0)