-
Notifications
You must be signed in to change notification settings - Fork 572
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
html-minifier produces invalid inline SVG #45
Comments
I'm not sure if this is a related issue, but using object tags seems to create a similar problem (I'm also using grunt-htmlmin, which uses html-minifier). However, I'm a complete Grunt noob, so it may well be something I'm doing wrong... This is my source html: <object type="image/svg+xml" data="image.svg">
<div>[fallback image]</div>
</object> This is the output html: <object type="image/svg+xml" data="image.svg">
</object><div>[fallback image]</div> As you can see, the inner div is somehow magically moved outside of the object. All the html-minifier options are set to whatever the defaults are. |
This could possibly be integrated with https://github.com/svg/svgo |
Bug still persists, tags inside svg are broken. I could not find any option to disable html-min for specific tags to solve this. |
I am having the same issue with inline svg in my html. I have a couple tags whose contents are populated with d3.js:
htmlmin produces the following:
Which causes the browser to interpret it as:
|
Duplicate of #76 |
This is the original SVG in my HTML:
And here is the result after html-minifier:
The SVG will not display properly any more (only the first rect is displayed). If I add ending slashes in the rect elements, it will display property, but it's still not valid SVG.
So maybe html-minifier shouldn't touch SVGs?
I originally reported it against gruntjs/grunt-contrib-htmlmin#19, that uses html-minifier.
The text was updated successfully, but these errors were encountered: