|
|
@@ -392,7 +392,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
this.onEventAttributeNames.forEach(attributeName => this.doc.querySelectorAll("[" + attributeName + "]").forEach(element => element.removeAttribute(attributeName)));
|
|
|
this.doc.querySelectorAll("[href]").forEach(element => {
|
|
|
if (element.href && element.href.match && element.href.match(/^\s*javascript:/)) {
|
|
|
- element.removeAttribute("href");
|
|
|
+ element.setAttribute("href", "");
|
|
|
}
|
|
|
});
|
|
|
this.doc.querySelectorAll("[src]").forEach(element => {
|
|
|
@@ -521,16 +521,16 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
if (responsiveImageData) {
|
|
|
if (tagName == "img") {
|
|
|
if (responsiveImageData.source.src && responsiveImageData.source.naturalWidth > 1 && responsiveImageData.source.naturalHeight > 1) {
|
|
|
- element.removeAttribute("srcset");
|
|
|
- element.removeAttribute("sizes");
|
|
|
+ element.setAttribute("srcset", "");
|
|
|
+ element.setAttribute("sizes", "");
|
|
|
element.src = responsiveImageData.source.src;
|
|
|
}
|
|
|
}
|
|
|
if (tagName == "picture") {
|
|
|
const imageElement = element.querySelector("img");
|
|
|
if (responsiveImageData.source && responsiveImageData.source.src && responsiveImageData.source.naturalWidth > 1 && responsiveImageData.source.naturalHeight > 1) {
|
|
|
- imageElement.removeAttribute("srcset");
|
|
|
- imageElement.removeAttribute("sizes");
|
|
|
+ imageElement.setAttribute("srcset", "");
|
|
|
+ imageElement.setAttribute("sizes", "");
|
|
|
imageElement.src = responsiveImageData.source.src;
|
|
|
element.querySelectorAll("source").forEach(sourceElement => sourceElement.remove());
|
|
|
} else {
|