kisstkondoros / gutter-preview

Other
158 stars 37 forks source link

SVG data URL no hover preview #147

Open andrewgoz opened 1 year ago

andrewgoz commented 1 year ago

The following code has a correct gutter preview, but the hover preview does not:

--icon-close: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3e%3cstyle%3epath{fill:black}%40media(prefers-color-scheme:dark){path{fill:white}}%3c/style%3e%3cpath d='M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z'/%3e%3c/svg%3e");

The tooltip starts with a "broken image" icon followed by (I've only quoted the first line):

data:image/svg+xml,%253csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F

It appears to be performing a second URL-encode of the already URL-encoded URL.