@@ -200,6 +200,33 @@ test('data: URI in <style> tag', function () {
200200});
201201
202202
203+ test ('unquoted SVG data: URI with parentheses in content ' , function () {
204+ $ result = (new CssInliner )
205+ ->addCss ("div { background-image: url(data:image/svg+xml,<svg><g transform='translate(50,50)'></g></svg>); } " )
206+ ->inline ('<html><body><div>X</div></body></html> ' );
207+
208+ Assert::contains ("background-image: url(data:image/svg+xml,<svg><g transform='translate(50,50)'></g></svg>) " , $ result );
209+ });
210+
211+
212+ test ('unquoted SVG data: URI with rgba() in content ' , function () {
213+ $ result = (new CssInliner )
214+ ->addCss ("div { background-image: url(data:image/svg+xml,<svg><rect fill='rgba(255,0,0,0.5)'/></svg>); } " )
215+ ->inline ('<html><body><div>X</div></body></html> ' );
216+
217+ Assert::contains ("background-image: url(data:image/svg+xml,<svg><rect fill='rgba(255,0,0,0.5)'/></svg>) " , $ result );
218+ });
219+
220+
221+ test ('unquoted SVG data: URI with url() reference in content ' , function () {
222+ $ result = (new CssInliner )
223+ ->addCss ("div { background-image: url(data:image/svg+xml,<svg><rect fill='url(#grad)'/></svg>); } " )
224+ ->inline ('<html><body><div>X</div></body></html> ' );
225+
226+ Assert::contains ("background-image: url(data:image/svg+xml,<svg><rect fill='url(#grad)'/></svg>) " , $ result );
227+ });
228+
229+
203230test ('braces inside string values in stylesheet ' , function () {
204231 $ result = (new CssInliner )->inline (
205232 '<html><head><style>.a { content: "{hello}"; color: red; } .b { margin: 0; }</style></head><body><p class="b">X</p></body></html> ' ,
0 commit comments