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

Mermaid diagrams: text labels overflow since 9.0.13 #5168

Closed
4 tasks done
frankie567 opened this issue Mar 8, 2023 · 3 comments
Closed
4 tasks done

Mermaid diagrams: text labels overflow since 9.0.13 #5168

frankie567 opened this issue Mar 8, 2023 · 3 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@frankie567
Copy link

Context

No response

Bug description

Labels in nodes and arrows are overflowing the size of their nodes.

Capture d’écran 2023-03-08 à 14 26 12

It happens since version 9.0.13. More specifically, it has probably been introduced by this commit: 5065bf9

Here is how it looked like in 9.0.12 and before:

Capture d’écran 2023-03-08 à 14 35 21

Suspected root cause

The variable --md-mermaid-font-family is now only defined under the .mermaid class and not in :root anymore. For some reasons, Mermaid compiler may not be able to pick it and thus compute the size of the nodes with its default font instead.

Workaround

If I manually set the variable in :root in custom CSS, it solves the issue:

:root > * {
  --md-mermaid-font-family: var(--md-text-font-family), sans-serif;
}

Related links

Reproduction

example.zip

Steps to reproduce

  1. Enable Mermaid superfence extension.
  2. Add a Mermaid diagram with long labels on nodes and arrows.

Browser

Chrome, Safari, Firefox

Before submitting

@squidfunk squidfunk added the needs investigation Issue must be investigated by the maintainers label Mar 8, 2023
@squidfunk
Copy link
Owner

Thanks for reporting, for the excellent reproduction, and for finding the root cause! I've checked and it seems that we can revert the change in _mermaid.scss, which solves this problem and doesn't re-introduce the problem fixed in #5034.

Fixed in 5b7cf17.

@squidfunk squidfunk added bug Issue reports a bug resolved Issue is resolved, yet unreleased if open and removed needs investigation Issue must be investigated by the maintainers labels Mar 9, 2023
@frankie567
Copy link
Author

Thank you for the super quick feedback and fix 🙏

@squidfunk
Copy link
Owner

Released as part of 9.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants