mugiwara85 / CodeblockCustomizer

Codeblock Customizer plugin for Obsidian
MIT License
147 stars 7 forks source link

Indented code blocks weird behavior #78

Open Aratopn opened 3 months ago

Aratopn commented 3 months ago

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

mugiwara85 commented 3 months ago

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

Aratopn commented 3 months ago

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

mugiwara85 commented 3 months ago

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

mugiwara85 commented 1 month ago

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.