You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there are references to similarly named image files (path to one file is a subpath to another one), one of both occurrences is replaced incorrectly.
This happens because the line:
source = source.replace(new RegExp(escapedRawUrl, 'g'), dataUri);
looks for any occurrences of the first imare url ignoring whether this is a full url (enclosed in quotes) or only a sub-url of another image.
Proposition: change the line to only replace full urls as follows:
source = source.replace(new RegExp('url(['"]\s_' + escapedRawUrl + '\s_['"])', 'g'), 'url("' + dataUri + '")');
The text was updated successfully, but these errors were encountered:
If there are references to similarly named image files (path to one file is a subpath to another one), one of both occurrences is replaced incorrectly.
Example:
.my-class-1 {
background-image: url("/folder1/my-image.png");
}
.my-class-2 {
background-image: url("/folder2/folder1/my-image.png");
}
Replacement result:
.my-class-1 {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAA...");
}
.my-class-2 {
background-image: url("/folder2data:image/png;base64,iVBORw0KGgoAAAA...");
}
This happens because the line:
source = source.replace(new RegExp(escapedRawUrl, 'g'), dataUri);
looks for any occurrences of the first imare url ignoring whether this is a full url (enclosed in quotes) or only a sub-url of another image.
Proposition: change the line to only replace full urls as follows:
source = source.replace(new RegExp('url(['"]\s_' + escapedRawUrl + '\s_['"])', 'g'), 'url("' + dataUri + '")');
The text was updated successfully, but these errors were encountered: