-
Notifications
You must be signed in to change notification settings - Fork 92
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
Font Awesome 6 SVG comments cause errors with plugin #124
Comments
Unfortunately the commented fixture doesn't run in tests right now, because babel can't parse it, so I'm not sure how we'd verify the fix. |
I'm almost definitely misunderstanding something, but isn't it being run on line 208 of I cloned the repo and ran |
ohh right, sorry, it's only svgo: false that's commented out. i'll look into it. |
This seems like it's a babel parse error, so it's something babel would have to fix. Could you file it there? |
I think you're wrong there. Babel is erroring, but that's because Babel is being asked to parse an XML comment as JSX and it isn't valid JSX. I did a little investigation and the issue is coming from the fact that SVGO deliberately doesn't remove these comments by default as they're apparently a convention used for copyright/licensing. svg/svgo#1811 |
hm, ok. in that case i'm not sure what the solution is, since this plugin uses babel to parse SVGs. |
An extra
!
has been added in the comments in the SVGs in Font Awesome 6, so they change from<!-- Font Awesome Pro 5...
to<!--! Font Awesome Pro 6...
I believe this additional
!
is causing issues for this plugin.Steps to reproduce
test/fixtures/commented.svg
in this repository, adding an extra!
between the<!--
and theF
which is currently the first non-whitespace character. It doesn't seem to matter if you add more whitespace before the extra!
, as long as the!
is the first non-whitespace character.Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: