Skip to content

Commit 78cc9b3

Browse files
docs(readme): update FAQ that parser doesn't do HTML sanitization
See #124
1 parent f1fc00b commit 78cc9b3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ const options = {
160160
if (!attribs) return;
161161

162162
if (attribs.id === 'main') {
163-
return (
164-
<h1 style={{ fontSize: 42 }}>{domToReact(children, options)}</h1>
165-
);
163+
return <h1 style={{ fontSize: 42 }}>{domToReact(children, options)}</h1>;
166164
}
167165

168166
if (attribs.class === 'prettify') {
@@ -200,11 +198,15 @@ parse('<p><br id="remove"></p>', {
200198

201199
#### Is this library XSS safe?
202200

203-
No, this library does **_not_** sanitize against [XSS (Cross-Site Scripting)](https://wikipedia.org/wiki/Cross-site_scripting). See [#94](https://github.com/remarkablemark/html-react-parser/issues/94).
201+
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).
202+
203+
#### Does this library sanitize invalid HTML?
204+
205+
No, this library does **_not_** perform HTML sanitization. See [#124](https://github.com/remarkablemark/html-react-parser/issues/124).
204206

205207
#### Are `<script>` tags parsed?
206208

207-
No, `<script>` tags are skipped because [react-dom](https://reactjs.org/docs/react-dom.html) does not render the contents. See [#98](https://github.com/remarkablemark/html-react-parser/issues/98).
209+
Although, `<script>` tags and their contents are rendered on the server-side, they are not evaluated on the client-side. See [#98](https://github.com/remarkablemark/html-react-parser/issues/98).
208210

209211
#### My HTML attributes aren't getting called.
210212

0 commit comments

Comments
 (0)