Mermaid.js 问题与框宽度切割文本

问题描述

我希望将 mermaid.js 集成到我的 Flask 应用程序中,但我遇到了一个奇怪的错误

框内的文字被剪短了大约 5-10 个像素

以下代码创建此输出

<div class="mermaid">
    %%{init: {
        'theme': 'forest',"flowchart" : { "curve" : "basis" } 
    } }%%
    graph LR
        id1[This is the text in the Box]
</div>

enter image description here

当您看到最后两个字母被裁剪时,所有框都会发生这种情况。

知道我应该如何解决这个问题吗?

解决方法

通过将字体大小减小到 90% 来修复它