Allow setting syntax highlighting language for inline code

We can already set the language for fenced code blocks, e.g. ```bash to start a properly highlighted shellscript block

In pandoc-style markdown (but not most others, I think), you can also set a highlighting language for inline code, e.g. `print('hello world!')`{.python} for a colorful inline python snippet. This would be a great feature in Obsidian for making beautiful computing notes

19 Likes

Would be great :star_struck:…because I am having A LOT of code snippets and fences in my notes! Thanks for this proposal!

2 Likes

I would also find this very useful. I often write myself code blocks with full examples and then I write a prose section or bullet points with inline code surrounded by English so I can get a theoretical idea of what the code is supposed to do.

Here is an example. (This note is network engineering commands, but I do the same thing for proper code.)

As you can see, there is no consistent highlighting across inline and code blocks.

I would love the ability to specify how the inline code snippets should be highlighted on a per-note basis using a YAML header. This would allow me to make high-quality evergreen notes with consistent code formatting.

Agreed–would be great to have language-specific code highlighting!

Is there a way of integrating a tool like Vale for prose linting directly or via plugin?

This would be great

Definitely need that too! +1

I agree, very useful idea.

+1 would be a great feature