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

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.

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?

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

Related feature requests (optional)

This is not a bug. It’s how markdown works. They are not two lists. They all belong the the same “loose list”.

I don’t think I implied that it was a bug here, which is why I placed this in the feature request category before it was moved to help. Or did I accidentally place it in the bug category?

Obsidian uses markdown as its format, but it’s by no means tied at the hip to the spec. It has, for example, an option to make single line breaks enough to create a line break Core even though this isn’t to spec.

I wasn’t aware of the concept of “loose lists” being part of the MD spec, but I would personally love a feature that would disable the “loose list” functionality so that lists broken up by a line break could be considered distinct lists, as I personally find that functionality super annoying. I know others do as well (see How to have a line break between list items without turning the list into a "loose" list, for example). Personally, this is one feature from more typical word processors that I miss.

Sure you can open a fr for breaking loose lists.

I might just be lost here. Is that not what I did with the OP? When I clicked “feature request” as the topic before submitting, it gave me the prompts I responded to in the OP. Is there a different format that I should have used?

Have you tried this markup?

- item 1
- item 2
- item 3
+ item a
+ item b
+ item c

For me this produces:
image

You can choose between three different list markers, and that is -, + and *. This trick works in the reading mode since it then produces distinct list, and common CSS applies some air around distinct lists. Live preview on the other hand mashes the list item back together, since it’s in general is bad at keeping air around its lines…

1 Like

Please open a new one and make it clear that you are asking for something that is breaking Markdown. We do try to follow the spec.

Another approach is to put a thematic break (what Obsidian’s docs call a “horizontal rule”) between the lists: Basic formatting syntax - Obsidian Help