sanitize-html
Advanced tools
Comparing version 1.25.0 to 1.26.0
## Changelog | ||
1.26.0: | ||
- Adds the `option` element to the default `nonTextTagsArray` of tags with contents that aren't meant to be displayed visually as text. This can be overridden with the `nonTextTags` option. | ||
1.25.0: | ||
@@ -4,0 +7,0 @@ - Adds `enforceHtmlBoundary` option to process code bounded by the `html` tag, discarding any code outside of those tags. |
{ | ||
"name": "sanitize-html", | ||
"version": "1.25.0", | ||
"version": "1.26.0", | ||
"description": "Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -13,3 +13,5 @@ # sanitize-html | ||
If a tag is not permitted, the contents of the tag are still kept, except for `script`, `style` and `textarea` tags. | ||
If a tag is not permitted, the contents of the tag are not discarded. There are | ||
some exceptions to this, discussed below in the "Discarding the entire contents | ||
of a disallowed tag" section. | ||
@@ -502,8 +504,9 @@ The syntax of poorly closed `p` and `img` elements is cleaned up. | ||
`style`, `script`, `textarea` | ||
`style`, `script`, `textarea`, `option` | ||
If you wish to expand this list, for instance to discard whatever is found inside a `noscript` tag, use the `nonTextTags` option: | ||
If you wish to replace this list, for instance to discard whatever is found | ||
inside a `noscript` tag, use the `nonTextTags` option: | ||
```javascript | ||
nonTextTags: [ 'style', 'script', 'textarea', 'noscript' ] | ||
nonTextTags: [ 'style', 'script', 'textarea', 'option', 'noscript' ] | ||
``` | ||
@@ -510,0 +513,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1637964
26352
545