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(postcss-svgo): skip non-SVG urls #1133
Conversation
test( | ||
'should skip non-SVG urls', | ||
passthroughCSS(`@font-face { | ||
src: url("../example/dfds.woff2") format("woff2"), |
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.
Can we add test with relative SVG URL?
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.
Good point. I think if everything works as expected the plugin should ignore it. The issue is in fact that it should ignore all URLs expect data:image
. The plugin cannot transform a SVG which is just linked but not inlined.
Codecov Report
@@ Coverage Diff @@
## master #1133 +/- ##
==========================================
+ Coverage 96.36% 96.42% +0.05%
==========================================
Files 115 115
Lines 3576 3578 +2
Branches 1051 1050 -1
==========================================
+ Hits 3446 3450 +4
+ Misses 121 119 -2
Partials 9 9
Continue to review full report at Codecov.
|
Updated. I suspect this is another consequence of #1034 When we removed |
We can check it using |
Fix #1050 Ensure it never starts processing an URL before making sure it is an inine SVG.
I've added another test with const dataURI = /data:image\/svg\+xml(;((charset=)?utf-8|base64))?,/i;
const dataURIBase64 = /data:image\/svg\+xml;base64,/i; The issue was that it |
@ludofischer @alexander-akait thank you both |
Fix #1050