silverbulletmd / silverbullet

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

Incorrect rendering of lists #895

Open MrMugame opened 1 week ago

MrMugame commented 1 week ago

This content gets rendered incorrectly

This is some text
* This is a bullet. This is a bullet. This is a bullet. This is a bullet. This is a bullet. This is a bullet. This is a bullet.
  * This is an indented bullet. This is an indented bullet. This is an indented bullet. This is an indented bullet.
This is some more text. This is some more text. This is some more text. This is some more text.

image

It should probably get rendered similarly to the way the preview does it image

(Shoutout to @opinionatedgeek on discord for pointing this out)

MrMugame commented 1 week ago

So there are two possible behaviours here:

  1. Make the text after the newline (This is some more text ...) part of the last bullet point and indent it.
  2. Don't do 1 and just create a new paragraph

but there are caveats to both

  1. Pressing enter would then not create a new bullet point which makes the whole typing flow very weird imo
  2. That's not markdown spec, meaning the lezer parser does 1 and I wouldn't really know how to change it without lot's of hacks or a fork

So I really don't know which route to take here. Obisidian for example does 2 and it feels pretty natural to me

zefhemel commented 1 week ago

Hmm. Not sure what the spec says, but logically I'd expect that last line to become a new paragraph, EXCEPT if it's indented at the same level as the list. In that case I'd see it as a new line still part of the list item. I see cases where I'd want to have a multi line/paragraph list item.

MrMugame commented 1 week ago

That would make sense and that is also what obsidian does (I think), but it is not according to spec and I'm frankly unsure on how we would change the way the parser works. This issue seems like it needs a smart hack