Skip to content

Commit

Permalink
fix: Fixed an issue with parent node mapping in MSIE11
Browse files Browse the repository at this point in the history
  • Loading branch information
cure53 committed Dec 17, 2020
1 parent d1cf8c6 commit 7e3a705
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 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.

6 changes: 3 additions & 3 deletions dist/purify.es.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.es.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 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.

6 changes: 3 additions & 3 deletions src/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,11 @@ function createDOMPurify(window = getGlobal()) {
* return. Return true otherwise.
*/
const _checkValidNamespace = function (element) {
let parent = element.parentElement;
let parent = element.parentNode;

// In JSDOM, if we're inside shadow DOM, then parentElement
// In JSDOM, if we're inside shadow DOM, then parentNode
// can be null. We just simulate parent in this case.
if (!element.parentElement) {
if (!parent || !parent.tagName) {
parent = {
namespaceURI: HTML_NAMESPACE,
tagName: 'template',
Expand Down

0 comments on commit 7e3a705

Please sign in to comment.