I have no idea if it is possible, but it would be great if there was an option to auto format the syntax in the code blocks. Something similar to what prettier does in Visual Code Studio.
Use case or problem
In many of my notes I’m just copy and pasting code already formatted by prettier but that format is lost in Obsidian.
This is something that I was looking for as well. My workaround is to open the md file in question with my code editor (Vim, in my case) and just paste it into the code block there.
I had a similar issue, how to keep code block style consistent across a large amount of markdown files, and ended up writing a tool, mdsf, that allows you to run “ordinary” code formatters like Black, Rustfmt and (Plus 100+ more) on markdown files.
It can currently only be run as a CLI or using a VSCode extension, but I am working on an Obsidian plugin.