You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How should a "U+002C COMMA character (,)" be escaped/replaced, if it is within an URL? Or in my particular case in data:image?
I wasn't able to escape: "data:image/svg+xml," (,)
with: "data:image/svg+xml%2C" (%2C)
in: srcset="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27472%27%20height%3D%27314%27%20viewBox%3D%270%200%20472%20314%27%3E%3Crect%20width%3D%27472%27%20height%3D%27314%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E ...."
oh. didn't think data URLs can end with ,. but aren't data URLs are, in most cases, "A valid non-empty URL that does not start or end with a U+002C COMMA character (,)" so can just placed safely in the secret attribute?
What is the issue with the HTML Standard?
According to https://html.spec.whatwg.org/multipage/images.html#srcset-attributes the srcset attribute may not contain ",":
4.8.4.2.1 Srcset attributes > 2: "A valid non-empty URL that does not start or end with a U+002C COMMA character (,)"
How should a "U+002C COMMA character (,)" be escaped/replaced, if it is within an URL? Or in my particular case in data:image?
I wasn't able to escape: "data:image/svg+xml," (,)
with: "data:image/svg+xml%2C" (%2C)
in: srcset="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27472%27%20height%3D%27314%27%20viewBox%3D%270%200%20472%20314%27%3E%3Crect%20width%3D%27472%27%20height%3D%27314%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E ...."
Notices:
1) I came here from https://github.com/orgs/rehypejs/discussions/78#discussioncomment-1632589, where is described similar issue with URLs without data:image
2) I'm sorry, if this is not a specification issue. In this case, I would kindly ask you, if you could send me a link to a solution (and possibly add it also to https://html.spec.whatwg.org/multipage/images.html#srcset-attributes)
The text was updated successfully, but these errors were encountered: