Kaynağa Gözat

replace the matching URL

Gildas 7 yıl önce
ebeveyn
işleme
fbc0540062
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      lib/single-file/single-file-core.js

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

@@ -1257,7 +1257,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 								if (duplicate && options.groupDuplicateImages) {
 									const tokens = [];
 									for (let token = declaration.value.children.head; token; token = token.next) {
-										if (token.data.type == "Url") {
+										if (token.data.type == "Url" && cssTree.generate(token.data.value) == originalResourceURL) {
 											const value = cssTree.parse("var(" + SINGLE_FILE_VARIABLE_NAME_PREFIX + indexResource + ")", { context: "value" }).children.head;
 											tokens.push({ token, value });
 										}
@@ -1266,7 +1266,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 									cssVariables.set(indexResource, content);
 								} else {
 									declaration.value.children.forEach(token => {
-										if (token.type == "Url") {
+										if (token.type == "Url" && cssTree.generate(token.value) == originalResourceURL) {
 											token.value.value = content;
 										}
 									});