Open qq191734369 opened 5 years ago
Hey there! Sorry for the late reply :(
Your approach would break for background: url(data:image…) 10vw 10vh no-repeat
for the same reasons #86 does. We need to make sure that the 123vw
is actually part of the url. The value might be pretty complex. However, crafting a regular expression that can do this without being prone to catastrophic backtracking isn't easy.
That said, I wonder if this shouldn't be done in replaceValues() anyway, something along the lines of:
'url(hello world) world'.replace(/(world)/g, (match, captureGroup, offset, text) => {
var inUnclosedUrl = text.slice(0, offset).match(/url\s*\([^)]*$/);
if (inUnclosedUrl) {
return match;
} else {
return 'mars';
}
})
// "url(hello world) mars"
Hello, I have a problem that the Regx can match 'vh vw' in the base64 image url, for example:
So, the image can't be displayed. I have seen the issue #34 and #86. But the Latest code has not fixed this bug.
I have an solution that can solve this problem:
Is this the best way ?...