Skip to content
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

Minification breaks inline SVG #6475

Closed
Arty2 opened this issue Nov 3, 2019 · 4 comments
Closed

Minification breaks inline SVG #6475

Arty2 opened this issue Nov 3, 2019 · 4 comments

Comments

@Arty2
Copy link

Arty2 commented Nov 3, 2019

An inline SVG is modified (and broken) by the minifier.
See the following after .005-.372:

Original:

<svg xmlns="http://www.w3.org/2000/svg" height="0.8rem" viewBox="0 0 3.375 2.912"><path stroke-width="0" d="M.166.1L.1.63s.417.054 1.355.063c.01.22.018.471.018.797 0 .056-.002.08-.003.132h-.397l.002-.133c0-.144-.003-.252-.005-.372a16.062 16.062 0 01-.53-.023c.003.128.006.246.006.396 0 .738-.03 1.123-.05 1.322.139-.01.32-.017.539-.023.011-.138.022-.358.03-.637h.395c-.01.286-.024.508-.035.63l.263-.002c.106 0 .178.003.273.004.019-.23.04-.592.04-1.294 0-.335-.007-.582-.015-.798.135-.002.282-.003.394-.006.01.221.018.475.018.804 0 .72-.028 1.096-.047 1.3.217.005.397.013.534.022.02-.23.043-.598.043-1.322 0-.35-.008-.606-.017-.828.245-.016.364-.032.364-.032L3.209.1s-.53.066-1.521.066C.696.167.166.1.166.1z"/></svg>

Minified:

<svg xmlns="http://www.w3.org/2000/svg" height=".8rem" viewBox="0 0 3.375 2.912"><path stroke-width="0" d="M.166.1.1.63s.417.054 1.355.063c.01.22.018.471.018.797.0.056-.002.08-.003.132h-.397l.002-.133c0-.144-.003-.252-.005-.372.003.128.006.246.006.396.0.738-.03 1.123-.05 1.322.139-.01.32-.017.539-.023.011-.138.022-.358.03-.637h.395c-.01.286-.024.508-.035.63l.263-.002c.106.0.178.003.273.004.019-.23.04-.592.04-1.294.0-.335-.007-.582-.015-.798.135-.002.282-.003.394-.006.01.221.018.475.018.804.0.72-.028 1.096-.047 1.3.217.005.397.013.534.022.02-.23.043-.598.043-1.322.0-.35-.008-.606-.017-.828.245-.016.364-.032.364-.032L3.209.1s-.53.066-1.521.066C.696.167.166.1.166.1z"></path></svg>

What version of Hugo are you using (hugo version)?

Hugo Static Site Generator v0.59.1-D5DAB232 windows/amd64 BuildDate: 2019-10-31T15:22:43Z

Does this issue reproduce with the latest release?

Yes (it is the latest)

@anthonyfok
Copy link
Member

Hi @Arty2, thank you for your report!

This looks to be an issue with the "minify" library that we use, and I have forwarded your report to tdewolff/minify#269, so please follow that issue there too.

If you were to experience any other issues related to minification, it would be great if you could create an issue at https://github.com/tdewolff/minify/issues which is closer to where it needs to be fixed.

Thanks!

@bf
Copy link

bf commented Jan 13, 2020

A variation of this is still an issue unfortunately, see: tdewolff/minify#284

Can we please have an option to disable inline SVG minification?

@bep
Copy link
Member

bep commented Jan 13, 2020

Can we please have an option to disable inline SVG minification?

Probably, but you need to create a separate issue.

@github-actions
Copy link

github-actions bot commented Feb 9, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants