-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix height of mermaid diagrams #2585
Conversation
if (el.style.maxWidth) { | ||
const maxWidth = parseFloat(el.style.maxWidth) | ||
|
||
ratio *= el.parentNode.clientWidth / maxWidth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may sound silly but can you explain to me how this works? 😄 Why did you multiply ratio with clientWidth / maxWidth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's to compensate the max-width 100% !important
applied on the svg.
el.parentNode.clientWidth / maxWidth
is the ratio between the available space and the diagram that mermaid wanted.
Sorry for let you wait for so long, can you fix the conflict @daiyam ? |
I tried on my MacOS and I can see that it works fine :) Would be nice if @daiyam could fix the merge issue. |
@qrospars I will try to fix it this week-end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
Description
This change fixes the height of the mermaid diagrams.
Issue fixed
Type of changes
Checklist:
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
IssueHunt has been backed by the following sponsors. Become a sponsor