question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Text in mermaid diagrams overflows in Firefox

See original GitHub issue

Contribution guidelines

I’ve found a bug and checked that …

  • … the problem doesn’t occur with the mkdocs or readthedocs themes
  • … the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • … the documentation does not mention anything about my problem
  • … there are no open or closed issues that are related to my problem

Description

I’m using mermaid sequence diagrams and seeing some issues on Firefox vs Chrome:

  1. text does not fit inside the notes block
  2. text (inscriptions on the arrows, messages) is not strictly above the arrows, but slides down on them

Expected behaviour

The text is displayed in the same way as in Google Chrome in any browser:

  1. text fits inside the notes, loops and other blocks
  2. text (inscriptions on the arrows, messages) is strictly above the arrows

Actual behaviour

on Firefox vs Chrome:

  1. text does not fit inside the notes, loops and other blocks
  2. text (inscriptions on the arrows, messages) is not strictly above the arrows, but slides down on them

Steps to reproduce

This can be reproduced on the main docs (just open it in Firefox but not Chrome): https://squidfunk.github.io/mkdocs-material/reference/diagrams/#using-sequence-diagrams

In this example the note is small but if it will be bigger than it would not fits inside the block image

Package versions

This can be replicated on the main docs

Configuration

This can be replicated on the main docs

System information

MacOS 12.2.1 (21D62) Monterey

  • Firefox 102.0.1 (64-bit) - issue present
  • Chrome 104.0.5112.101 (Official Build) (x86_64) - no issue
  • Safari 15.3 (17612.4.9.1.8) - no issue

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
facelessusercommented, Sep 30, 2022

Yep, that turned out to be the exact fix I had done in my code, which I see is now why I did not have the same issue.

Apparently, I had even documented it:

      sequence: {
        useMaxWidth: false,
        // Mermaid handles Firefox a little different.
        // For some reason, it doesn't attach font sizes to the labels in Firefox.
        // If we specify the documented defaults, font sizes are written to the labels in Firefox.
        noteFontWeight: "14px",
        actorFontSize: "14px",
        messageFontSize: "16px"
      },
0reactions
facelessusercommented, Oct 1, 2022

Oh, that makes sense. I was just curiously looking to see if I had inadvertently done the same thing on accident, then I saw the comment and realized I had done it purposely, not accidentally 🙃.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mermaid Integration — Firefox Source Docs documentation
Mermaid is a tool that lets you generate flow charts, sequence diagrams, gantt charts, class diagrams and vcs graphs from a simple markup...
Read more >
How to install Mermaid to render flowcharts in markdown?
I created a Firefox & Chrome extension that wasn't available at the time of the first answer: Github + Mermaid. To use it...
Read more >
Mermaid scaling / Text Cufoff or Overflowing - Obsidian Forum
My mermaid diagrams have way too much vertical space. I'm running Windows 10, and my screen is set to 200% scale. Example Code:...
Read more >
Prism
Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind. It's used in millions of websites, including some of...
Read more >
9 flowchart and diagramming tools for Linux - Opensource.com
A confusing business organization chart. Image by: Opensource.com ... The default text size, 22.68pt, or about 8mm, seems a bit weird.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found