Skip to content

Commit

Permalink
test: update flowchart3 test case
Browse files Browse the repository at this point in the history
Mermaid v10.2.0 changed some behavior for htmlLabels with embedded
SVG images. The `width=100%` is now set in the node CSS, which normally
scales the images to the width of the text, but for this SVG, it seems
to crop it. See mermaid-js/mermaid#4455.

Setting a well-defined `viewBox` attribute to our SVG fixes this.

Co-authored-by: Laura Valentine Tscharner <[email protected]>
  • Loading branch information
2 people authored and MindaugasLaganeckas committed Jun 12, 2023
1 parent 40e05a6 commit 5111452
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test-positive/flowchart3.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ graph TD
B-->D(fa:fa-spinner);
B-->E(A fa:fa-camera-retro perhaps?);
%% Test whether embed <img> work correctly
D-->F("<img height='100' width='100' src='data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2240%22 stroke=%22black%22 stroke-width=%223%22 fill=%22red%22 /%3E%3C/svg%3E'/> <br/> Red Circle")
D-->F("<img height='100' width='100' src='data:image/svg+xml,%3Csvg viewBox=%220 0 100 100%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2240%22 stroke=%22black%22 stroke-width=%223%22 fill=%22red%22 /%3E%3C/svg%3E'/> <br/> Red Circle")

0 comments on commit 5111452

Please sign in to comment.