Obsidian does not follow CommonMark indented code spec

Steps to reproduce

Type the following:

        this should start with 4 spaces
    this is the start of a block

	which should continue here
	and trailing spaces should NOT be included   

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

Yes.

Expected result

the first line should be an inline code block starting with four spaces, not a doubly indented code block

The 2nd and 4th line should be part of the same code block.

the 5th line should not have trailing spaces included in the block

(in addition, each indent line is rendered as a separate block, though this may be intended behavior)

Environment

SYSTEM INFO:
Obsidian version: 1.12.7
Installer version: 1.12.4
Operating system: #1 SMP PREEMPT_DYNAMIC Wed, 25 Feb 2026 23:12:35 +0000 6.18.13-arch1-1
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

1 Like

I don’t think you are right in this case

I think copy-paste destroyed the formatting, and I should have put first and second line in separate blocks

To be clear, with . as spaces:

........this should start with 4 spaces


and for the second part:

....this is the start of a block
..
....which should continue here

You are right about the final part though i misread that.

PS: just noticed, this is another issue which is limited to the edit view, so yeah I was mostly wrong on this.