Explorar el Código

compress style attribute contents

Gildas hace 7 años
padre
commit
1c48e7cb54
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      lib/single-file/single-file-core.js

+ 1 - 1
lib/single-file/single-file-core.js

@@ -635,7 +635,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		async attributeStyles(initialization) {
 			await Promise.all(Array.from(this.doc.querySelectorAll("[style]")).map(async element => {
 				const stylesheetContent = initialization ? await DomProcessorHelper.resolveImportURLs(element.getAttribute("style"), this.baseURI, { maxResourceSize: this.options.maxResourceSize, maxResourceSizeEnabled: this.options.maxResourceSizeEnabled }) : await DomProcessorHelper.processStylesheet(element.getAttribute("style"), this.baseURI);
-				element.setAttribute("style", stylesheetContent);
+				element.setAttribute("style", this.options.compressCSS ? this.dom.uglifycss(stylesheetContent) : stylesheetContent);
 			}));
 		}