Editing Mode causes entire document to format as code when code block is preceded by indented list item

When in editing mode, the markdown formatting of code blocks renders incorrectly in the following situation:

  1. Build a list that has an indented sublist item as its final item of the list.
  2. Below this list, create a code block.
  3. Add a language formatting type to the code block (example: ```python ).
  4. Add more text to the document below, and outside, the end of the code block.

Result: With the language type added to the code block, all the text beyond the code block also formats as code while editing, affecting the remainder of the entire document.

  • Shifting the indent of the final list sub-item, so that it is no longer indented, corrects this behavior
  • Removing the language type from the code block correct this behavior

Note: The text following the code block renders correctly when in reading mode. This is an editing mode issue.

obsidian_codeblock_formatting_bug_sm

About Obsidian
Version 1.8.10 (Installer 1.8.9)

Hi welcome to the forum. Please follow the provided template when making a bug report. It includes a link (and a question) about trying the troubleshooting steps. For now, I’ve moved it to help while we get more info.

  • Did you test this without community plugins?
  • Did you test this in the Sandbox help vault?
  • Please try downloading installer 1.8.10 or later. It has a bug fix that might be related:

“Fixed several issues with numbered lists getting numbered incorrectly, such as when list items have leading spaces, or appear inside neighboring block quotes.”

I am not on the same installer, but I can’t reproduce this. But I think I remember seeing something similar several months ago, and it might be fixed by now.

1 Like

It looks alright on my end as well. Obsidian Sandbox, v1.9.2 (v1.8.9 installer).

source mode | live preview | reading view

Obsidian_Dl9T7lcqR0