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

[v2.6.1] Removal of svg output elements causes missing elements #291

Closed
pocc opened this issue Feb 26, 2020 · 3 comments
Closed

[v2.6.1] Removal of svg output elements causes missing elements #291

pocc opened this issue Feb 26, 2020 · 3 comments

Comments

@pocc
Copy link

pocc commented Feb 26, 2020

Problem

minify removes subgraph clusters, edgePaths, edgeLabels, and nodes.

Details

You can visually see the difference in the SVG on the main page of tshark.dev for different deploys:

Working: https://tshark.dev
Failing: https://5e5631ba1523330008ceb7be--pedantic-lumiere-bf6286.netlify.com/
SVG HTML ID: mermaid-tshark-dev

You can get the full SVG for both with document.getElementById('mermaid-tshark-dev').outerHTML in your browser's dev console.

document.querySelector('#mermaid-tshark-dev > g > g').children.length and document.querySelector('#mermaid-tshark-dev > g > g > g').children.length both return 4 for the working version and 1 for the failing version (there are at least 6 HTMLElements that are missing).

Failing instance info

Hugo Version: 0.65.3 (3 days ago)
Minify version (per go.mod): v2.6.1

Errata

This relates to breakage with SVGs generated by MermaidJS like #260.

@tdewolff
Copy link
Owner

Thanks for the report! Seems that SVG has an element called foreignObject which is parsed as something other than SVG. I've added code to skip minification of the contents of those tags, fixing this bug. Let me know if this works for you!

@pocc
Copy link
Author

pocc commented Mar 11, 2020

Thanks for the fix! Which tagged version will feature this commit (and when can we expect that release)?

@tdewolff
Copy link
Owner

Released v2.7.3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants