sanitize-html
Advanced tools
Comparing version 1.23.0 to 1.24.0
## Changelog | ||
1.24.0: | ||
- Fixes a bug where self-closing tags resulted in deletion with `disallowedTagsMode: 'escape'` set. Thanks to [Thiago Negri](https://github.com/thiago-negri) for the contribution. | ||
- Adds `abbr` to the default `allowedTags` for better accessibility support. Thanks to [Will Farrell](https://github.com/willfarrell) for the contribution. | ||
- Adds a `mediaChildren` property to the `frame` object in custom filters. This allows you to check for links or other parent tags that contain self-contained media to prevent collapse, regardless of whether there is also text inside. Thanks to [axdg](https://github.com/axdg) for the initial implementation and [Marco Arduini](https://github.com/nerfologist) for a failing test contribution. | ||
1.23.0: | ||
@@ -4,0 +9,0 @@ - Adds eslint configuration and adds eslint to test script. |
{ | ||
"name": "sanitize-html", | ||
"version": "1.23.0", | ||
"version": "1.24.0", | ||
"description": "Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis", | ||
@@ -56,2 +56,2 @@ "sideEffects": false, | ||
} | ||
} | ||
} |
@@ -110,3 +110,3 @@ # sanitize-html | ||
allowedTags: [ 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol', | ||
'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div', | ||
'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'abbr', 'code', 'hr', 'br', 'div', | ||
'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'iframe' ], | ||
@@ -305,6 +305,7 @@ disallowedTagsMode: 'discard', | ||
- `tag`: The tag name, i.e. `'img'`. | ||
- `attribs`: The tag's attributes, i.e. `{ src: "/path/to/tux.png" }`. | ||
- `text`: The text content of the tag. | ||
- `tagPosition`: The index of the tag's position in the result string. | ||
- `tag`: The tag name, i.e. `'img'`. | ||
- `attribs`: The tag's attributes, i.e. `{ src: "/path/to/tux.png" }`. | ||
- `text`: The text content of the tag. | ||
- `mediaChildren`: Immediate child tags that are likely to represent self-contained media (e.g., `img`, `video`, `picture`, `iframe`). See the `mediaTags` variable in `src/index.js` for the full list. | ||
- `tagPosition`: The index of the tag's position in the result string. | ||
@@ -311,0 +312,0 @@ You can also process all text content with a provided filter function. Let's say we want an ellipsis instead of three dots. |
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
1624029
27461
528