Browse Source

fixed copy of the style attribute

Gildas 7 năm trước cách đây
mục cha
commit
23fd7c51d1
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      lib/single-file/html-images-minifier.js

+ 1 - 1
lib/single-file/html-images-minifier.js

@@ -181,7 +181,7 @@ this.imagesMinifier = this.imagesMinifier || (() => {
 							svgElement.appendChild(titleElement);
 						}
 						svgElement.setAttribute(SINGLE_FILE_IMAGE_ATTRIBUTE, "");
-						const style = svgElement.getAttribute("style") || "";
+						const style = imgElement.getAttribute("style") || "";
 						svgElement.setAttribute("style", style + (style && ";") + "box-sizing:content-box!important;width:" + imageData.clientWidth + "px!important;" + "height:" + imageData.clientHeight + "px!important");
 						svgElement.setAttributeNS(SVG_NS, "viewBox", "0 0 " + width + " " + height);
 						svgElement.setAttributeNS(SVG_NS, "width", imageData.clientWidth);