Handle quoted strings in data url (#84)

* handle quoted strings in data url

* unrefactor

* update package json

* Revert "update package json"

This reverts commit 9446109b0f94d9e569a961642f1e57b1a67793ee.

* change background-image to border-image
This commit is contained in:
AssafKr
2026-04-01 12:00:00 +08:00
committed by GitHub
parent d9133fd7ac
commit 3c7aeb3b13
4 changed files with 12 additions and 3 deletions

View File

@@ -89,6 +89,14 @@ describe('absolute url to stylesheet', () => {
).to.equal(
'url(\'data:image/svg+xml;utf8,<svg width="28" height="32" viewBox="0 0 28 32" xmlns="http://www.w3.org/2000/svg"><path d="M27 14C28" fill="white"/></svg>\')',
);
expect(
absoluteToStylesheet(
'url("data:image/svg+xml;utf8,<svg width=\"28\" height=\"32\" viewBox=\"0 0 28 32\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M27 14C28\" fill=\"white\"/></svg>")',
href,
),
).to.equal(
'url("data:image/svg+xml;utf8,<svg width=\"28\" height=\"32\" viewBox=\"0 0 28 32\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M27 14C28\" fill=\"white\"/></svg>")',
);
});
it('can handle empty path', () => {
expect(absoluteToStylesheet(`url('')`, href)).to.equal(`url('')`);