kovetskiy/mark

Image width with mermaid.go is too small when running headless

ralph089 opened this issue · 0 comments

What happened?
When using mermaid with mermaid.go in a headless environment the produced image width is too small. The image width is 784 px. Therefore only one shape fits in each row and they are all placed below each other.

8c910226964824ef26e801cf7d5e533839f006a559c4b95f6165155f8d3f794e

What did you expect to happen?
The created image is being produced using more width, so it looks like in the IntelliJ markdown preview or the image in GitHub. The images are displayed there as I would expect them to look like (even if there are differences).

GitHub

C4Context
      title Test Title
      Enterprise_Boundary(b0, "Test") {
          System_Ext(Test, "Test", "Allows customers to view information about their bank accounts, and make payments.")
  
          System_Boundary(b1, "Boundary") {
              
                  System(Test2, "Test2", "Allows customers to view information about their bank accounts, and make payments.")
                  System(Test3, "Test3", "Allows customers to view information about their bank accounts, and make payments.")
                  System(Test4, "Test4", "Allows customers to view information about their bank accounts, and make payments.")
            }

          System_Ext(Test5, "Test5", "Allows customers to view information about their bank accounts, and make payments.")
          SystemQueue_Ext(Test6, "MQ")
      }

      Rel(Test, Test2, "Sample Text", "HTTP")

    Rel(Test3, Test2, "Sample Text", "HTTP")

    UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
Loading

IntelliJ Markdown Viewer:

image

How can we reproduce the behavior you experienced?
Steps to reproduce the behavior:

  1. Create a Markdown file which contains a mermaid diagram with multiple shapes which should be placed next to each other
  2. Run mark using mermaid.go
  3. Compare the image with the one from GitHub

In case this is related to specific markdown, please provide a minimal markdown example here.

```mermaid
C4Context
      title Test Title
      Enterprise_Boundary(b0, "Test") {
          System_Ext(Test, "Test", "Allows customers to view information about their bank accounts, and make payments.")
  
          System_Boundary(b1, "Boundary") {
              
                  System(Test2, "Test2", "Allows customers to view information about their bank accounts, and make payments.")
                  System(Test3, "Test3", "Allows customers to view information about their bank accounts, and make payments.")
                  System(Test4, "Test4", "Allows customers to view information about their bank accounts, and make payments.")
            }

          System_Ext(Test5, "Test5", "Allows customers to view information about their bank accounts, and make payments.")
          SystemQueue_Ext(Test6, "MQ")
      }

      Rel(Test, Test2, "Sample Text", "HTTP")

    Rel(Test3, Test2, "Sample Text", "HTTP")

    UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")

Information (please complete the following information)

  • Mark Version (mark --version): 9.11.1
  • Mark Parameters: --debug --mermaid-provider mermaid-go --drop-h1
  • Confluence Hosting: Server
  • Confluence Version: 8.5.4
  • Environment specific Information: running in GitHub Actions using the mark Docker Image