-
Notifications
You must be signed in to change notification settings - Fork 12
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
Made picosvg ignore <?xpacket?> tags. #288
Conversation
ad43ccb
to
d756a14
Compare
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.
hi! thanks for the PR, the changes look good to me. Just one thing about the test. We don't need to create a whole new test module just for the xpackets, it's sufficient that you add a test inside tests/svg_test.py
.
Also, you could assert that the svg no longer contains the xpacket elements.
regarding the CI |
Hey @anthrotype, I moved the test to The thing is - I only ignored WDYT?
|
they are removed, but not in simplify. The The simplify method is about removing groups, applying clip-paths and transforms (stuff that needs to be done all at once as opposed to one at a time) and isn't really meant to be called in isolation from the rest, but as part of How about you add a new |
- Abstracted out "check if tag is a comment" into _is_redundant(tag). - Added etree.ProcessingInstruction to the set of redundant tags. - Created function to remove processing instructions. - Changed topicosvg to remove processing instructions. - Added test to ensure xpacket tags no longer break picosvg, and are actually removed when topicosvg is called.
Ah, now it makes more sense. Thank you for explaining. I updated the PR to add a function to remove processing instructions (like comments are removed), and made |
Cool, thanks! I am happy with this PR now, but I don't have write access, so please merge at will :) |
Thank you! |
Likewise! Woohoo! |
FYI, I made a minor fixup to the tests here |
Ah, that's much nicer - thanks! |
actually removed when topicosvg is called.