Make Obsidian's behavior on codeblocks dependent on their type

Currently Obsidian treats all codeblocks in the same way. This has some quirky side effects. It would be better to distinguish between code-containing codeblocks and text-containing codeblocks (ala admonition).

In text codeblocks, markdown auto-pairing should be enabled, suggestions should be enabled (tags, links), and linked and unlinked mention should be picked up.

In code codeblocks, markdown autopairing should be disabled, markdown suggestions should be disabled (tags, links), and linked and unlinked mention should not be picked up.

Notes

There is a simplified version of this FR, that simply asks to disable all markdown assistance within codeblocks link.

22 Likes

I’m having a related issue. I have an espanso shortcut that autopairs triple backticks for codeblocks for me already. I also have custom ones for admonition. I use it outside of Obsidian, but now that Obsidian has added it, I get a very dissatisfying set of five rows of triple backticks. Since I use other espanso shortcuts on Obsidian fine, I don’t want to turn the whole thing off when I go to Obsidian. So being able to customize autocomplete would be desirable.

1 Like

I have not used espanso in a while and I was never a heavy user but this might be a solution for you specific problem: App-specific configurations | Espanso