sanitize-html 2.7.1 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +8 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -521,6 +521,14 @@ function sanitizeHtml(html, options, _recursing) {
521
521
  // Do not crash on bad markup
522
522
  return;
523
523
  }
524
+
525
+ if (frame.tag !== name) {
526
+ // Another case of bad markup.
527
+ // Push to stack, so that it will be used in future closing tags.
528
+ stack.push(frame);
529
+ return;
530
+ }
531
+
524
532
  skipText = options.enforceHtmlBoundary ? name === 'html' : false;
525
533
  depth--;
526
534
  const skip = skipMap[depth];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanitize-html",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "Clean up user-submitted HTML, preserving allowlisted elements and allowlisted attributes on a per-element basis",
5
5
  "sideEffects": false,
6
6
  "main": "index.js",