Skip to content

Commit

Permalink
fix: Slightly changed the execution order for __depth tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
cure53 committed Apr 24, 2024
1 parent ce799c3 commit 81d963c
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions dist/purify.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.cjs.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/purify.es.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,11 @@ function createDOMPurify() {

/* Now start iterating over the created document */
while (currentNode = nodeIterator.nextNode()) {
/* Sanitize tags and elements */
if (_sanitizeElements(currentNode)) {
continue;
}

/* Set the nesting depth of an element */
if (currentNode.nodeType === 1) {
// eslint-disable-next-line unicorn/prefer-ternary
Expand All @@ -1389,11 +1394,6 @@ function createDOMPurify() {
_forceRemove(currentNode);
}

/* Sanitize tags and elements */
if (_sanitizeElements(currentNode)) {
continue;
}

/* Shadow DOM detected, sanitize it */
if (currentNode.content instanceof DocumentFragment) {
_sanitizeShadowDOM(currentNode.content);
Expand Down
2 changes: 1 addition & 1 deletion dist/purify.es.mjs.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/purify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,11 @@ function createDOMPurify(window = getGlobal()) {

/* Now start iterating over the created document */
while ((currentNode = nodeIterator.nextNode())) {
/* Sanitize tags and elements */
if (_sanitizeElements(currentNode)) {
continue;
}

/* Set the nesting depth of an element */
if (currentNode.nodeType === 1) {
// eslint-disable-next-line unicorn/prefer-ternary
Expand All @@ -1513,11 +1518,6 @@ function createDOMPurify(window = getGlobal()) {
_forceRemove(currentNode);
}

/* Sanitize tags and elements */
if (_sanitizeElements(currentNode)) {
continue;
}

/* Shadow DOM detected, sanitize it */
if (currentNode.content instanceof DocumentFragment) {
_sanitizeShadowDOM(currentNode.content);
Expand Down

0 comments on commit 81d963c

Please sign in to comment.