mermaid-js / mermaid-cli

Command line tool for the Mermaid library
MIT License
2.48k stars 234 forks source link

ci(test): fix convert-svg-to-png in mermaid 9.1.7 #389

Closed aloisklink closed 2 years ago

aloisklink commented 2 years ago

:bookmark_tabs: Summary

Mermaid v9.1.7 implemented commit https://github.com/mermaid-js/mermaid/commit/2968b400c49f66983e6d206959504e72aa6ae0ef that removes the width attr from SVGs by default, using the CSS max-width style instead.

Percy CI (used for visual regression tests) does not yet support SVGs, so we use convert-svg-to-png@v0.5.0, but that requires either the width or the height to calculate the size of the PNG to convert to SVG to.

To fix this, the Mermaid useMaxWidth option can be set to false. Annoyingly, we need to do this for every single graph type, see https://mermaid-js.github.io/mermaid/#/Setup?id=usemaxwidth

Should fix the failing CI in PR #383.

:straight_ruler: Design Decisions

N/A

:clipboard: Tasks

Make sure you

MindaugasLaganeckas commented 2 years ago

Thank you for the fix! I have been a bit busy lately. Consider participating in https://hacktoberfest.com/ I have already labeled your PR :)

aloisklink commented 2 years ago

Thank you for the fix! I have been a bit busy lately.

No worries :) Open-source is working for free, so it's something to do only if we have free time! (or if we want a free T-shirt!)

Consider participating in https://hacktoberfest.com/ I have already labeled your PR :)

:+1: Apparently this year they're also giving rewards for maintainers that review/merge PRs.