Skip to content

1.2.48

Choose a tag to compare

@github-actions github-actions released this 31 Jul 13:11
· 6 commits to main since this release
Bump to v1.2.48 — Diagram labels keep their last character

A node label written as `name<br/><i>path/</i>` came out with the path cut short:
"resume-builder/resume-dr", the trailing slash gone. v1.2.47 already waited for
Inter before rendering, on the grounds that mermaid measures a label and then
draws the box around the measurement, so a font arriving between those two steps
leaves the box too narrow and a `<foreignObject>` clips the overflow. That was
right, but it waited for one face. A label is not one face: `<i>` and `<b>`
inside it pull in the italic and bold cuts too, and the app never draws in Inter
Italic anywhere else, so that face was not merely late — it had never loaded at
all. Measured in the fallback, drawn in the real thing, three pixels short.

Wait for all four cuts a label can use, and hand `document.fonts.load` the
diagram's own text while doing it: Inter arrives from @fontsource split across
unicode ranges, and the em dash in "resume-builder — the monolith" lives in a
different subset from the ASCII either side of it.

The wait is now capped rather than open-ended. A window that isn't compositing
can leave both `fonts.load` and `fonts.ready` pending for as long as it stays
that way, and the dialog would sit on its spinner with no way out; after two
seconds it renders regardless. And `foreignObject` no longer clips, so a label
that still doesn't fit overhangs its box instead of losing its tail — untidy,
but readable, which silently dropping the last two characters is not.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>