Socket
Socket
Sign inDemoInstall

sanitize-html

Package Overview
Dependencies
Maintainers
15
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sanitize-html - npm Package Compare versions

Comparing version 1.25.0 to 1.26.0

3

CHANGELOG.md
## 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.

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc