From 1bb154d6f4d24670facf562df0318a0df2ce0223 Mon Sep 17 00:00:00 2001 From: djmaze Date: Wed, 23 Sep 2020 11:48:08 +0200 Subject: [PATCH] Bugfix: The ability to list more than one selector in :not() is experimental and not yet widely supported. --- dev/External/SquireUI.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/External/SquireUI.js b/dev/External/SquireUI.js index a948fb5e5..69e9bf8f5 100644 --- a/dev/External/SquireUI.js +++ b/dev/External/SquireUI.js @@ -59,9 +59,10 @@ const doc = document, tpl.querySelectorAll('[data-x-div-type]').forEach(el => el.replaceWith(getFragmentOfChildren(el))); if (isPaste) { tpl.querySelectorAll(removeElements).forEach(el => el.remove()); - tpl.querySelectorAll(':not('+allowedElements+')').forEach(el => el.replaceWith(getFragmentOfChildren(el))); tpl.querySelectorAll('*').forEach(el => { - if (el.hasAttributes()) { + if (!el.matches(allowedElements)) { + el.replaceWith(getFragmentOfChildren(el)); + } else if (el.hasAttributes()) { [...el.attributes].forEach(attr => { let name = attr.name.toLowerCase(); if (!allowedAttributes.includes(name)) {