[FR] New Lines in Lists (Numbered & Bullet) Should Produce Distinct Lists Elements

Reposting this per WhiteNoise’s request. Further, per their request, I’m clarifying that this feature would be a diversion from markdown spec. This is why it should be an optional feature, similar to the already-existing markdown-breaking option to use strict line breaks.

Use case or problem

When I write session notes for my D&D games, I typically use lists. This helps me keep my points concise and functional. However, I sometimes have multiple “sections” under one heading that don’t, to me, warrant a new header, but which are somewhat distinct. I like to separate these distinct “sections”, each formed with a bulleted list. I tend to do this with a new line (enter).

However, this new line doesn’t get translated over to the reading view. It’s either totally ignored by some themes (like default Obsidian), or it will cause every item in the list to be separated by a new line (like with default ITS theme).

For example:

- Item 1
- Item 2

- Item 3
- Item 4

in edit view will equate out to either:

- Item 1

- Item 2

- Item 3

- Item 4

or

- Item 1
- Item 2
- Item 3
- Item 4

After some discussion with SIRvb when I requested they add a feature to respect the new line to the ITS theme, they let me know that Obsidian currently doesn’t leave anything in the HTML indicating that a new line was placed within a list, so there’s no way to properly process them. The theme can either make everything be broken up by new lines or make nothing broken up by new lines.

WhiteNoise pointed out this is a feature of Markdown called loose lists. I, along with many others (as shown in the linked posts below), find this feature to be more of a annoyance than a feature and would like some way to break the function to behave more like nearly every other format aside from markdown.

Proposed solution

This brings me to my proposed solution. Would it be possible for Obsidian, when processing the HTML, to create a unique <ol> or <ul> for a list when there is a new line breaking elements apart while an option like “disable loose lists” is on?

In other words…

- Item 1
- Item 2

- Item 3
- Item 4

would render out to

<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
<ol>
<li>Item 3</li>
<li>Item 4</li>
</ol>

Current workaround (optional)

I can sort of workaround this by…

  1. Inserting some kind of text in between the lists, like this:
- Item 1
- Item 2
break it up (or %%break it up%% to be invisible about it)
- Item 3
- Item 4
  1. Inserting a header in between the lists, like this:
- Item 1
- Item 2
# break it up
- Item 3
- Item 4
  1. Another user also pointed out that using different sigils can also work, like this:
- Item 1
- Item 2

+ Item 1
+ Item 2

Related feature requests (optional)

https://www.reddit.com/r/ObsidianMD/comments/xf7wdj/is_it_by_design_that_putting_a_gap_between_any/

Old Thread:

Another thought: rather than breaking the MD spec, what if there was an optional feature that would look to see what list sigil was used before and after the current point, if there is one, and and determine which of the two wasn’t used and change -, +, or * to that sigil?

For example…

- Item 1
- Item 2

(insertion point)

+ Item 5
+ Item 6

If I started typing at the insertion point above, using - as the sigil, Obsidian would auto correct those sigils to be * instead since it is distinct from the list sigil before it and distinct from the list sigil after it.