Skip to content

Commit 039e1c1

Browse files
docs(readme): update FAQ with error and SSR section
1 parent 5045387 commit 039e1c1

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

README.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ $ yarn add html-react-parser
5656
Import the module:
5757

5858
```js
59-
// CommonJS
60-
const parse = require('html-react-parser');
61-
6259
// ES Modules
6360
import parse from 'html-react-parser';
61+
62+
// CommonJS
63+
const parse = require('html-react-parser');
6464
```
6565

6666
Parse single element:
@@ -228,19 +228,27 @@ parse('<br>', {
228228

229229
#### Is this library XSS safe?
230230

231-
No, this library is **_not_** [XSS (Cross-Site Scripting)](https://wikipedia.org/wiki/Cross-site_scripting) safe. See [#94](https://github.com/remarkablemark/html-react-parser/issues/94).
231+
No, this library is _**not**_ [XSS (cross-site scripting)](https://wikipedia.org/wiki/Cross-site_scripting) safe. See [#94](https://github.com/remarkablemark/html-react-parser/issues/94).
232232

233233
#### Does this library sanitize invalid HTML?
234234

235-
No, this library does **_not_** perform HTML sanitization. See [#124](https://github.com/remarkablemark/html-react-parser/issues/124).
235+
No, this library does _**not**_ perform HTML sanitization. See [#124](https://github.com/remarkablemark/html-react-parser/issues/124) and [#125](https://github.com/remarkablemark/html-react-parser/issues/125).
236236

237237
#### Are `<script>` tags parsed?
238238

239239
Although `<script>` tags and their contents are rendered on the server-side, they're not evaluated on the client-side. See [#98](https://github.com/remarkablemark/html-react-parser/issues/98).
240240

241241
#### Why aren't my HTML attributes getting called?
242242

243-
This is because [inline event handlers](https://developer.mozilla.org/docs/Web/Guide/Events/Event_handlers) (e.g., `onclick`) are parsed as a _string_ instead of a _function_. See [#73](https://github.com/remarkablemark/html-react-parser/issues/73).
243+
This is because [inline event handlers](https://developer.mozilla.org/docs/Web/Guide/Events/Event_handlers) like `onclick` are parsed as a _string_ instead of a _function_. See [#73](https://github.com/remarkablemark/html-react-parser/issues/73).
244+
245+
#### The parser throws an error.
246+
247+
Check if your arguments are valid. Also, see ["Does this library sanitize invalid HTML?"](https://github.com/remarkablemark/html-react-parser#does-this-library-sanitize-invalid-html).
248+
249+
#### Does this library support SSR?
250+
251+
Yes, this library supports server-side rendering on Node.js. See [demo](https://repl.it/@remarkablemark/html-react-parser-SSR).
244252

245253
## Benchmarks
246254

0 commit comments

Comments
 (0)