Bläddra i källkod

don't override style element contents with empty stylesheets

Gildas 7 år sedan
förälder
incheckning
c83fefdc76
1 ändrade filer med 3 tillägg och 1 borttagningar
  1. 3 1
      lib/single-file/single-file-core.js

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

@@ -465,7 +465,9 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			if (this.options.stylesheetContents) {
 				let indexStyle = 0;
 				this.doc.querySelectorAll("style").forEach(styleElement => {
-					styleElement.textContent = this.options.stylesheetContents[indexStyle];
+					if (this.options.stylesheetContents[indexStyle]) {
+						styleElement.textContent = this.options.stylesheetContents[indexStyle];
+					}
 					indexStyle++;
 				});
 			}