Explorar o código

replace the matching URL

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
fbc0540062
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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;
 										}
 									});