-
-
Notifications
You must be signed in to change notification settings - Fork 7.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
Add option to disable inline SVG minification #6750
Comments
I suggest we add a new |
The bug has been fixed. I appreciate the report.
Actually it's a fairly easy problem. The only thing that makes it hard is making it remotely fast, which requires a lot of byte fiddling which is very bug prone. The HTML minifier has had a lot more testing in this regard so it's no surprise that it is more stable. The SVG test set is fairly complete to be honest so I'm not sure what you mean with rudimentary. Bugs creep in but that is normal in any piece of software. The phrase "partially implemented; in development" means just that: thus far it should be production ready but there is still a lot of potential to minify further. Same goes for the JS minifier. |
Dear @tdewolff, thanks for your quick bugfix & immediate response to this issue! I think minify is a great project. But as you said there are still potential future issues (speed / byte fiddling) with some aspects of the tool. Therefore it'd be great if we could have a choice which formats to minify when calling it from within the hugo toolchain. |
Fixes gohugoio#6750 Updates gohugoio#6892
Fixes gohugoio#6750 Updates gohugoio#6892
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The
minify
tool used by hugo to minify the output works great on HTML, but there have been several issues with it destroying inlined SVGs:These issues stem from the fact that
minify
changes the svg<path>
attributes and attempts to optimize the drawing of lines on the svg canvas. This is a very hard problem, and as a result hugo users are affected by SVG optimization bugs from time to time. Furthermore, the testing for SVG minification in theminify
repo seems to still be rudimentary: https://github.com/tdewolff/minify/blob/master/svg/pathdata_test.goIn
minify
project readme https://github.com/tdewolff/minify it says:"Status: SVG: partially implemented; in development"
I think in light of this, we should add an option to disable inline SVG minification, or - even better - be able to pass options through to minify if another class of problems emerges.
The text was updated successfully, but these errors were encountered: