Empty lines in code blocks mess up bullet lists

Steps to reproduce

  1. Create a bullet list
  2. Add a code block under some list item
  3. Add some blank lines to the code block
  4. Switch to preview mode

Expected result

The bullet list is displayed normally

Actual result

The list inserts some whitespace between the items

To make it work normally, we need to indent the empty lines in the code block to the same level as the surrounding lines

Environment

  • Operating system: Windows
  • Obsidian version: 0.10.8

Additional information

The VS Code mardown renderer handles these two cases correctly:

Thanks. this is an upstream bug.

I’m not sure if this is the same bug or a separate one. I find that if I have an indented code block that happens to fall after a list, it isn’t rendered as an indented code block unless the code block is double indented.

image