Fixed detection of multiple consecutive CSS URLs without quotes (#4)

This commit is contained in:
Daniël van de Giessen
2026-04-01 12:00:00 +08:00
committed by yz-yu
parent 61c50c2122
commit 4ed15164c9
2 changed files with 9 additions and 2 deletions

View File

@@ -47,6 +47,12 @@ describe('absolute url to stylesheet', () => {
);
});
it('can handle multiple no quote paths', () => {
expect(absoluteToStylesheet('background-image: url(images/b.jpg); background: #aabbcc url(images/a.jpg) 50% 50% repeat;', href)).to.equal(
`background-image: url('http://localhost/css/images/b.jpg'); background: #aabbcc url('http://localhost/css/images/a.jpg') 50% 50% repeat;`,
);
});
it('can handle data url image', () => {
expect(
absoluteToStylesheet('url(data:image/gif;base64,ABC)', href),