First line of code block without language specifier is indented extra 2px

Steps to reproduce

type the following into a new note (use help vault to reproduce):


Expected result (preview)


Actual result (first line is indented)



  • Operating system: macOS 12.0.1
  • Obsidian version: 0.13.5


Adding the following custom CSS “fixes” it

.markdown-preview-view code {
	padding: 0px;
1 Like

Hmm, that’s odd. What does the inspector say the padding CSS is coming from (hit cmd + shift + i)?
In a new note in the help notes vault, I’m not getting that indent. According to my inspector, there is a padding rule for .markdown-preview-view code but it is overridden by another rule for .markdown-preview-view pre code.

I’m on Windows 10, with Obsidian v0.12.19

@Craftidore This is a new bug for 0.13.x

1 Like

will be fixed in 0.13.8


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