CodeblockCustomizer icon indicating copy to clipboard operation
CodeblockCustomizer copied to clipboard

Indented code blocks weird behavior

Open Aratopn opened this issue 1 year ago • 4 comments

I have noticed indented code blocks weird behavior. I think this started after the new obsidian update (v1.5.11, 19.03.2024).

Obsidian - v 1.5.11 CodeblockCustomizer - v 1.2.6

  1. Editing (source mode) 1_editing_source 2_editing_source

  2. Editing 1_editing 2_editing

  3. Reading 1_reading 2_reading

Aratopn avatar Mar 22 '24 09:03 Aratopn

Hmm. Interesting. The 4th picture is correct in editing mode. Can you send me the readme file?

mugiwara85 avatar Mar 22 '24 09:03 mugiwara85

Do you mean .txt file with this markdown text? I am a bit newbie) test.txt

Aratopn avatar Mar 22 '24 09:03 Aratopn

sorry, I meant the markdown file. my bad :) Yeah, this works. I will look at it, and get back to you

mugiwara85 avatar Mar 22 '24 10:03 mugiwara85

Hi @Aratopn, sorry for the delay, but I finally had time to look at this problem. I looked at the document you sent. Only the second code block is not working correctly. So, the problem is, that if you simply create a code block and then push it right with TAB, then Obsidian actually "converts" it to inline code: image

I probably could make this work, so that background color, and other colors are applied correctly, but the problem is, that syntax highlighting is also not applied. Even if I did all that, this code block would still not work as a normal code block does. I see this as an Obsidian issue, but hopefully they will fix it soon.

However, if you want to indent a code block, you can do that, by adding it to a list. But I see from your document, that you already figured that out.

mugiwara85 avatar May 20 '24 19:05 mugiwara85

Did not receive any reply...

mugiwara85 avatar Apr 20 '25 19:04 mugiwara85