terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.

Home Page:https://d2lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Markdown rendering issue when using `theme-id: 300` (Terminal)

Didas-git opened this issue · comments

I was writting some note in markdown and i came accross this weird issue where the last word doesnt get rendered, it adds the space for the word but not the word itself.

I have a really small reproduction of this on the playground

And i will leave a screenshot attached for clarification as well.
image

dev notes:

It's the mono rule in the theme that's effecting it. I've inspected the pre-processisng code in d2graph and the some of the code in textmeasure. Can't find anything amiss. Even adding +1 to the width makes enough room. But this can't be reproduced unless it's mono font, so it must be something to do with that condition only.

There's some things we do in textmeasure that's "for code only". It doesn't affect code block shapes because their measurements don't need to be as precise (there's padding). That was customized some, so maybe something we did there is off-by-one.