gt6796c / mermaid-tw5

Tiddly Wiki 5 plugin to support the mermaid library
MIT License
19 stars 10 forks source link

Mermaid Graphs cut off text at the end #14

Closed dm1090 closed 3 years ago

dm1090 commented 4 years ago

The Mermaid graph is not rendering last letter of any label.

image

We can try to resolve this by add extra characters to the end. The problem is part of those extra characters are visible.

sobjornstad commented 3 years ago

This is happening for me, too -- but oddly it looks fine when previewing a tiddler.

sobjornstad commented 3 years ago

Found the culprit: the tc-tiddler-body CSS class increases the font size to 15px from 14px, while the plugin appears to be rendering expecting the font size to be 14px (as it is when previewing, since the tc-tiddler-body class is not above it in the DOM).

Quick workaround, add the following to a tiddler tagged $:/tags/Stylesheet:

/* Override bugfix for plugin: https://github.com/gt6796c/mermaid-tw5/issues/14 */

.tc-tiddler-body div > svg {
  font-size: 14px;
}
dm1090 commented 3 years ago

That worked @sobjornstad. Thanks very much.