ソースを参照

fixed multiline comment containing /*

Gildas 5 年 前
コミット
90bfa3451b
1 ファイル変更5 行追加1 行削除
  1. 5 1
      lib/single-file/single-file-core.js

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

@@ -916,11 +916,15 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 			async function processElement(element, stylesheetInfo, stylesheets, baseURI, options, workStyleElement) {
 				stylesheets.set(element, stylesheetInfo);
 				let stylesheetContent = await getStylesheetContent(element, baseURI, options, workStyleElement);
+				if (element.href && element.href.includes("style.css")) {
+					debugger
+				}
 				const match = stylesheetContent.match(/^@charset\s+"([^"]*)";/i);
 				if (match && match[1] && match[1] != options.charset) {
 					options.charset = match[1];
 					stylesheetContent = await getStylesheetContent(element, baseURI, options, workStyleElement);
 				}
+				if (element.href && element.href.includes("styles.css")) { }
 				let stylesheet;
 				try {
 					stylesheet = cssTree.parse(Util.removeCssComments(stylesheetContent));
@@ -2027,7 +2031,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 		}
 
 		static removeCssComments(stylesheetContent) {
-			return stylesheetContent.replace(/\/\*.+?\*\//g, "");
+			return stylesheetContent.replace(/\/\*(.|\s)+?\*\//g, "");
 		}
 
 		static wrapMediaQuery(stylesheetContent, mediaQuery) {