sanitize-html
Advanced tools
+7
-1
@@ -569,2 +569,7 @@ const htmlparser = require('htmlparser2'); | ||
| result += text; | ||
| } else if ((options.disallowedTagsMode === 'discard' || options.disallowedTagsMode === 'completelyDiscard') && (nonTextTagsArray.indexOf(tag) !== -1)) { | ||
| // htmlparser2 does not decode entities inside raw text elements like | ||
| // textarea and option. The text is already properly encoded, so pass | ||
| // it through without additional escaping to avoid double-encoding. | ||
| result += text; | ||
| } else if (!addedText) { | ||
@@ -675,3 +680,4 @@ const escaped = escapeHtml(text, false); | ||
| const lastParsedIndex = parser.endIndex; | ||
| if (lastParsedIndex != null && lastParsedIndex >= 0 && lastParsedIndex < html.length) { | ||
| if (lastParsedIndex != null && lastParsedIndex >= 0 && | ||
| lastParsedIndex < html.length) { | ||
| const unparsed = html.substring(lastParsedIndex); | ||
@@ -678,0 +684,0 @@ result += escapeHtml(unparsed); |
+2
-2
| { | ||
| "name": "sanitize-html", | ||
| "version": "2.17.1", | ||
| "version": "2.17.2", | ||
| "description": "Clean up user-submitted HTML, preserving allowlisted elements and allowlisted attributes on a per-element basis", | ||
@@ -27,3 +27,3 @@ "sideEffects": false, | ||
| "escape-string-regexp": "^4.0.0", | ||
| "htmlparser2": "^8.0.0", | ||
| "htmlparser2": "^10.1.0", | ||
| "is-plain-object": "^5.0.0", | ||
@@ -30,0 +30,0 @@ "parse-srcset": "^1.0.2", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
70178
0.61%928
0.65%+ Added
+ Added
- Removed
Updated