Jelajahi Sumber

fix retrieval of charset

Gildas 5 tahun lalu
induk
melakukan
97ccfed2a2
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      lib/single-file/single-file-core.js

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

@@ -1605,7 +1605,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 					resourceReferrer: options.resourceReferrer
 				});
 				if (!matchCharsetEquals(content.data, content.charset || options.charset)) {
-					options = Object.assign({}, options, { charset: getCharset(stylesheetContent) });
+					options = Object.assign({}, options, { charset: getCharset(content.data) });
 					return getStylesheetContent(resourceURL);
 				} else {
 					return content;
@@ -1661,7 +1661,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 					validateTextContentType: true
 				});
 				if (!matchCharsetEquals(content.data, content.charset || options.charset)) {
-					options = Object.assign({}, options, { charset: getCharset(stylesheetContent) });
+					options = Object.assign({}, options, { charset: getCharset(content.data) });
 					return ProcessorHelper.resolveLinkStylesheetURLs(resourceURL, baseURI, options, workStylesheet);
 				}
 				resourceURL = content.resourceURL;