silverbulletmd / silverbullet

The hackable notebook
https://silverbullet.md
MIT License
2.04k stars 141 forks source link

Word wrapping behavior is different when markdown symbols present where line would break. #808

Open theparadox1083 opened 3 months ago

theparadox1083 commented 3 months ago

In the text in the code block below, my instance of SilverBullet breaks the line after do and before eiusmod, resulting in eiusmod starting a new line.

Normally, adjacent characters and symbols like (, [ and " all wrap to the next line if the complete "word" would not fit on the current line. However with SilverBullet if there are markdown formatting symbols at the point where the line break would occur, the line breaks before the formatting symbols and the leaves the beginning of the "word" behind on the previous line. It's as though the formatting symbols are assumed to occur at the beginning or end of a "word" when determining line breaks.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do (eiusmod) tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do (**eiusmod**) tempor incididunt ut labore et dolore magna aliqua.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do “eiusmod” tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do “*eiusmod*“ tempor incididunt ut labore et dolore magna aliqua.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ei~~usmod~~ tempor incididunt ut labore et dolore magna aliqua.

How it looks on my instance: image

zefhemel commented 3 months ago

Yes. I've noticed this too. No concrete ideas on how to fix yet though.