|
|
@@ -1466,10 +1466,12 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
|
|
|
if (!Util.testIgnoredPath(resourceURL)) {
|
|
|
if (!resourceURL || Util.testValidPath(resourceURL)) {
|
|
|
let resolvedURL;
|
|
|
- try {
|
|
|
- resolvedURL = util.resolveURL(resourceURL, baseURI);
|
|
|
- } catch (error) {
|
|
|
- // ignored
|
|
|
+ if (!originalResourceURL.startsWith("#")) {
|
|
|
+ try {
|
|
|
+ resolvedURL = util.resolveURL(resourceURL, baseURI);
|
|
|
+ } catch (error) {
|
|
|
+ // ignored
|
|
|
+ }
|
|
|
}
|
|
|
if (Util.testValidURL(resolvedURL) && resourceURL != resolvedURL && stylesheetContent.includes(urlFunction)) {
|
|
|
stylesheetContent = stylesheetContent.replace(Util.getRegExp(urlFunction), originalResourceURL ? urlFunction.replace(originalResourceURL, resolvedURL) : "url(" + resolvedURL + ")");
|
|
|
@@ -1566,12 +1568,14 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
|
|
|
let variableDefined;
|
|
|
const tokens = [];
|
|
|
findURLToken(originalResourceURL, declaration.value.children, (token, parent, rootFunction) => {
|
|
|
- if (duplicate && options.groupDuplicateImages && rootFunction) {
|
|
|
- const value = cssTree.parse("var(" + SINGLE_FILE_VARIABLE_NAME_PREFIX + indexResource + ")", { context: "value" }).children.head;
|
|
|
- tokens.push({ parent, token, value });
|
|
|
- variableDefined = true;
|
|
|
- } else {
|
|
|
- token.data.value.value = content;
|
|
|
+ if (!originalResourceURL.startsWith("#")) {
|
|
|
+ if (duplicate && options.groupDuplicateImages && rootFunction) {
|
|
|
+ const value = cssTree.parse("var(" + SINGLE_FILE_VARIABLE_NAME_PREFIX + indexResource + ")", { context: "value" }).children.head;
|
|
|
+ tokens.push({ parent, token, value });
|
|
|
+ variableDefined = true;
|
|
|
+ } else {
|
|
|
+ token.data.value.value = content;
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
if (variableDefined) {
|