Inconsistent indentation with lists/sublists

Steps to reproduce

some list:
1. some item
2. another item

**some bold text**
3. a third item continuing the list

a new list:
2. one item
- sub item
- another sub item
3. another item

**some more bold text**
1. a new item, restarting numbering at zero

Expected result

List items to be aligned with other list items, not with sublist items. And numbering should not be affecting alignment I guess?

Actual result

Environment

  • Operating system: MacOS Big Sur 11.5.2 (20G95)
  • Obsidian version: 0.12.15

Additional information

Like this?

some list:
1. some item
1. another item   
**some bold text**
1. a third item continuing the list

a new list:
1. one item
	- sub item
	- another sub item
1. another item

**some more bold text**
1. a new item, restarting numbering at zero

Angel

there’s nothing really wrong here, just how markdown works

Right so the mistake I was doing is trying to continue the numbering from a previous list, which Obsidian doesn’t recognize (and as @WhiteNoise noted, probably isn’t compliant markdown syntax — I’m still learning).

Thanks for clearing that up!

What is odd though is that beginning a list with e.g. “3.” and pressing enter automatically updates the next line with “4.” (so Obsidian recognizes this as a list) but it doesn’t get rendered as a list afterwards in the Preview pane. So to be sure, is it possible, or is it not, to list items by writing a digit other than “0” ? Markdown syntax seems to suggest only “0” is correct, but Obsidian’s autocomplete suggests otherwise it seems.

List numbering when parsed (viewed in the preview panel) is determined by the first number used in the list in the editor.

While writing, the editor will increment the numbers automatically, or users can override them. See the samples below.

  • In the first, I used 0 for every item in the editor
  • In the second, I started with 22 and let the editor auto-number each item
  • In the third, I used random numbers

In the output, the numbers increment from the first item in each list.

#### First List
0. A
0. B
0. C
0. D

#### Second List
22. A
23. B
24. C
25. D

#### Third List
9. A
66. B
9990. C
239. D

If list numbering is incorrect when parsed, it is probably because of the line-spacing used above or below the list. Lists need to be in discrete blocks to render correctly.

Angel

Right, but expanding on your last example, consider this:

Shouldn’t list alignment be the same in both cases?

List 1 and 2 is actually precisely the layout I was looking for initially :slight_smile:

With hash-based headers, you can get away with not having an empty line between the header and the list (though many people would advise using a blank line after the header / before the list).

With lists 3 and 4, which have words in bold as pseudo-headers, the list elements need to be separated by an empty line. They will then be seen as lists and formatted correctly. See the screenshot below.

Angel

3 Likes

@Angel I see! Didn’t know markdown could be so tricky about empty lines :wink:

Thanks for the reply !

Welcome. You’re winning. That’s all that matters. :smiley:

Angel