|
|
@@ -958,7 +958,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
}
|
|
|
|
|
|
static isolateElements(rootElement) {
|
|
|
- rootElement.querySelectorAll("*").forEach(element => {
|
|
|
+ rootElement.querySelectorAll("*:not(style)").forEach(element => {
|
|
|
if (element.getAttribute(SELECTED_CONTENT_ATTRIBUTE_NAME) == "") {
|
|
|
element.removeAttribute(SELECTED_CONTENT_ATTRIBUTE_NAME);
|
|
|
} else if (!element.querySelector("[" + SELECTED_CONTENT_ATTRIBUTE_NAME + "]")) {
|
|
|
@@ -970,13 +970,13 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
function isolateParentElements(parentElement, element) {
|
|
|
if (parentElement) {
|
|
|
Array.from(parentElement.childNodes).forEach(node => {
|
|
|
- if (node != element && node.tagName != "HEAD" && node.tagName != "STYLE") {
|
|
|
+ if (node != element && node.tagName != "STYLE") {
|
|
|
node.remove();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
element = element.parentElement;
|
|
|
- if (element && element.parentElement) {
|
|
|
+ if (element && element.parentElement && element.parentElement.tagName != "BODY") {
|
|
|
isolateParentElements(element.parentElement, element);
|
|
|
}
|
|
|
}
|