CodeblockCustomizer icon indicating copy to clipboard operation
CodeblockCustomizer copied to clipboard

Indented Blocks Problem

Open kylecreate opened this issue 1 year ago • 11 comments

I'm really unsure of how to describe this problem honestly which is why I have so many screenshots.

Obsidian: v1.5.12 Codeblock Customizer Plugin: 1.2.6

Obsidian_ZOUpQKPTh3 Obsidian_5sbJQa7Cym Obsidian_alX4EtyAEJ Obsidian_Hbyatqpldf Obsidian_QhFGmN0yak Obsidian_SQ4YXzLU5E

kylecreate avatar Jun 02 '24 11:06 kylecreate

Can you send me your md file? But as i can see the code blocks are not part of the list, that's what causes the problem, I think. But I will know more if you send me your md file.

mugiwara85 avatar Jun 02 '24 12:06 mugiwara85

Here's the file. Deleted the original one, but re-made it.

Codeblocks.md

kylecreate avatar Jun 02 '24 21:06 kylecreate

I see the problem now. You did not indent the code blocks properly. image

You did not indent the line with the closing backticks. Just go into that line press Home to get to the beginning of the line, and TAB. That's it. After that it should work.

mugiwara85 avatar Jun 06 '24 10:06 mugiwara85

Thanks for the response. After indenting the lines on some of my learning notes, I'm still having this problem. The first image is from the Source Mode and the second one is from Live Preview. Source Mode Live Preview

kylecreate avatar Jun 07 '24 00:06 kylecreate

can you send me your document again?

mugiwara85 avatar Jun 07 '24 07:06 mugiwara85

Here you go! Multi-Block.md

kylecreate avatar Jun 07 '24 13:06 kylecreate

Indenting code blocks only works unfortunately if they are in a list. The problem is that obsidian converts indented code blocks to inline code. This also means that they are not handled as code blocks anymore, because the required classes are not associated with the lines. I haven't found a solution for this yet, but I'll take a look again, since you are the second person (#78) with this problem. I consider it as an Obsidian problem though. If I find a workaround, I'll let you know. I leave this issue open until then.

mugiwara85 avatar Jun 07 '24 14:06 mugiwara85

I do have also a highlighting problem but no need to spam open issues. Technically I think it's well placed in here anyway. I hope you don't mind :)

My edit view works great. image

However when I'm switching to reading view it looks like this: image

As I looked through some issues targeting kind of a similar problem where the reading view is working - except for indenting issues. But I cannot see any of those. That's the file I was taking the screen shots from. I kept it as simple as possible.

test.md

Since I saw it working for others I'm curious why my reading view wouldn't work correctly.

I'm currently working with Obsidian 1.6.7 and Codeblock Customizer 1.2.7 - with almost all default settings except "Enable editor active line highlight", which I turned off. I also tried to disable all other community plugins to check whether one of them is causing issues. Sadly, that didn't do the trick.. :/

Besides my issue: Awesome plugin!

olaffthunder avatar Jul 30 '24 16:07 olaffthunder

@olaffthunder specify cpp as code block language ;)

mugiwara85 avatar Jul 30 '24 17:07 mugiwara85

Bloody hell.. Thank you for pointing out the obvious thing I didn't try... ><

olaffthunder avatar Jul 30 '24 17:07 olaffthunder

Bloody hell.. Thank you for pointing out the obvious thing I didn't try... ><

No problem :)

mugiwara85 avatar Jul 30 '24 17:07 mugiwara85