-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVG id attribute not validated. #1977
Comments
JSUYA
added a commit
to JSUYA/thorvg
that referenced
this issue
Feb 14, 2024
empty id is invalid. Therefore, set it to null and make it is not used. issue: thorvg#1977
hermet
pushed a commit
that referenced
this issue
Feb 15, 2024
empty id is invalid. Therefore, set it to null and make it is not used. issue: #1977
Okay, let's see.
So we only need to abide by the following:
So we're good with id's for now. |
hermet
pushed a commit
that referenced
this issue
Feb 23, 2024
empty id is invalid. Therefore, set it to null and make it is not used. issue: #1977
hermet
pushed a commit
that referenced
this issue
Apr 5, 2024
empty id is invalid. Therefore, set it to null and make it is not used. issue: #1977
hermet
pushed a commit
that referenced
this issue
Apr 6, 2024
empty id is invalid. Therefore, set it to null and make it is not used. issue: #1977
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://svgwg.org/svg2-draft/struct.html#Core.attrib
So the id attribute should only work with strings that are a non-zero length sequence of
":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
The id attribute is meant to go by NmToken rules. But instead, it works for everything, even empty strings. Example:
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><linearGradient id="" x2="1"><stop stop-color="#fac"/></linearGradient><rect width="16" height="16" fill="url(#)"/></svg>
The text was updated successfully, but these errors were encountered: