Adding a second level bullet point right after a code block leads to the bullet point being treated as code

Steps to reproduce

  1. Create a code block, like:
this is a code block
  1. Right after the end of the code block, add a second-level bullet point, like:
    • This is a second-level bullet point

Did you follow the troubleshooting guide? [Y/N]

Yes, it fails there too. This is the code of what I tried:

code block 1
  • First-level bullet point
code block 2
- Second-level bullet point 

Expected result

I was expecting the second-level bullet point after code block 2 to be rendered as a regular second-level bullet point (as it does correctly for first-level bullet points), not to be rendered as a code line

Actual result

The second-level bullet point got rendered as a code line.


Obsidian version: v1.5.12
Installer version: v1.4.16
Operating system: Windows 10 Enterprise 10.0.22631
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on


Additional information

This is how I see it:

A second level bullet point only can exist under a first level bullet point.

I was thinking the same. The code block in there breaks the list.

Something like this could work if the code block is in the list, but it’s fiddly getting the spacing correct in Live Preview.

code block 1

- list item

    code block 2
	- sublist item 

Reading view pic:

1 Like

It’s not a bug. It’s a correct implementation of Markdown. Obsidian’s Help pages state:

You can also create a code block by indenting the text using Tab or 4 blank spaces.

You created a code block, where the first line starts with a hyphen.