You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -244,7 +244,7 @@ parse('<br>', {
244
244
245
245
### htmlparser2
246
246
247
-
This library passes the following options to [htmlparser2](https://github.com/fb55/htmlparser2/tree/v3.10.1)on the server-side:
247
+
The default options passed to [htmlparser2](https://github.com/fb55/htmlparser2/tree/v3.10.1)are:
248
248
249
249
```js
250
250
{
@@ -253,9 +253,9 @@ This library passes the following options to [htmlparser2](https://github.com/fb
253
253
}
254
254
```
255
255
256
-
By passing your own options, the default library options will be **replaced** (not merged).
256
+
Since [v0.12.0](https://github.com/remarkablemark/html-react-parser/tree/v0.12.0), you can override the default options by passing [htmlparser2 options](https://github.com/fb55/htmlparser2/wiki/Parser-options).
257
257
258
-
As a result, to enable `decodeEntities` and `xmlMode`, you need to do the following:
258
+
Here's an example in which [`decodeEntities`](https://github.com/fb55/htmlparser2/wiki/Parser-options#option-decodeentities) and [`xmlMode`](https://github.com/fb55/htmlparser2/wiki/Parser-options#option-xmlmode) are enabled:
259
259
260
260
```js
261
261
parse('<p /><p />', {
@@ -266,9 +266,7 @@ parse('<p /><p />', {
266
266
});
267
267
```
268
268
269
-
See [htmlparser2 options](https://github.com/fb55/htmlparser2/wiki/Parser-options).
270
-
271
-
> **Warning**: By overriding htmlparser2 options, there's a chance of breaking universal rendering. Do this at your own risk.
269
+
> **Warning**: `htmlparser2` is only applicable on the _server-side_ (Node.js) and not applicable on the _client-side_ (browser). By overriding `htmlparser2` options, there's a chance that universal rendering breaks. Do this at your own _risk_.
0 commit comments