Bladeren bron

if undefined, always set charset value to the one given in options

Gildas 7 jaren geleden
bovenliggende
commit
71c9a47617
1 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 4 4
      lib/single-file/single-file-browser.js

+ 4 - 4
lib/single-file/single-file-browser.js

@@ -104,17 +104,17 @@ this.SingleFileBrowser = this.SingleFileBrowser || (() => {
 			if (!contentType.includes("/")) {
 				contentType = null;
 			}
-			const charsetValue = matchContentType[1] && matchContentType[1].trim().toLowerCase();
+			const charsetValue = matchContentType[1] && matchContentType[1].trim();
 			if (charsetValue) {
 				const matchCharset = charsetValue.match(/^charset=(.*)/);
 				if (matchCharset && matchCharset[1]) {
 					charset = docHelper.removeQuotes(matchCharset[1].trim());
 				}
-				if (!charset && options.charset) {
-					charset = options.charset.trim();
-				}
 			}
 		}
+		if (!charset && options.charset) {
+			charset = options.charset;
+		}
 		if (options && options.asDataURI) {
 			try {
 				if (DEBUG) {