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.

Environment

SYSTEM INFO:
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

RECOMMENDATIONS:
none


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.

I’ve been fighting with the same issue for a while. You can find information below on how to make it work:

Create a code block using the three (`), add the code, and then use the tab key to indent each line inside the code block. You will see the code block correctly indented when using the Reading View. By doing it this way, the bullet point underneath the code block will no longer display as “code.”

Also, as a side note, this only works up to three indentation levels.

This is not a bug. Harr explanation is correct. The parser used by the forum software does the same thing.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.