-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
fix(parser): Skip id
attribute from normalization
#10079
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
id
attribute from normalizationid
attribute from normalization
This kind of attribute has issues as well, right? |
attr === 'xlink:href' || | ||
attr === 'font' || | ||
attr === 'id' | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is a bit weird.
We do carry a parse and and outputValue around and in some cases we just do an early return.
Hopefully there is a better way to fix it. All the attributes that start with a number that are not specially taken care of here are going to be wrong correct?
So any custom attribute will need to be listed here and that is not really feasible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it better to explicitly specify which one needs to be normalized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
somehow this function become really convoluted yesterday i tried to look at it to expedite this fix. Eventually we can just fix as you did and open a ticket for a refactor, i didn't decide it yet sorry.
@miroljub1995 add this line to the changelog: and we can merge. Please check that it gets formatted as the other lines or we get a lint error. |
|
There are maybe warnings, the checkmark is green. |
Description
If we load SVG that has some object with
id
attribute starting with anumber
, we get a wrong id parsed.