mugiwara85/CodeblockCustomizer

feature request: Indent before the code block

Closed this issue ยท 11 comments

There is a known problem in obsidian - this is the design of code blocks inside lists in live preview:
https://forum.obsidian.md/t/live-preview-better-support-of-code-blocks-in-lists/31352/57

Unfortunately, the authors have been dealing with the problem for almost 2 years and without result.

At the same time, you have a wonderful extension that greatly improves the user experience!

If you could add indents in front of your code blocks in the extension, it would be wonderful!

Thanks!

You mean when a codeblock is inside a list? You mean the red vertical line I drew in with red (between 1 and 2)?
image

I mean the need for indentation before the code block in some cases (for example, inside the list)

image

If there is an opportunity to implement this in your extension, it would be great!

ah sorry. You mean indentation. I was thinking about indentation lines. Sorry, my bad.
But I am still confused a little. On the picture the codeblock is indented, or not? Maybe we are not talking about the same thing. Could you send two pictures. One where it is wrong, and one where I can see what you need?

Of course:
image

In reading mode it should work.
image

In edit mode it doesn't. I didn't even notice that. I will look into this

can you name other cases when the code block needs to be intended? You said, inside a list, but what are the other cases?

Here are the cases that come to mind:

image

If possible, you could set the left indent depending on the number of spaces before the first set of or set it to the option after (example):css indent:4

thank you! I might have an idea how to solve this. I try to solve it until the next release.

Just a quick question. This way would it be ok?
image

It's not perfect, because the indentation lines are missing, but I didn't find another way to solve this reliably.

Available in version 1.2.4. Please test it, and if there is any problem, just report back.