mProjectsCode / obsidian-shiki-plugin

MIT License
43 stars 6 forks source link

Is there a way to highlight inline code too? #10

Closed nuanjanP closed 3 months ago

nuanjanP commented 5 months ago

Is your feature request related to a problem? Please describe. I'm looking for a way to specify a language for inline code (in markdown syntax) so that it is highlighted.

I've tried inline raw HTML such as <code class="language-python">print('hello world')</code>. This does get highlighted, but also automatically turned into a code block. I'd like it to remain as inline code.

Describe the solution you'd like It would be great if there's a way we can specify language for inline code in markdown syntax (that is, code using just backticks, not raw HTML) and highlight it accordingly.

mProjectsCode commented 5 months ago

Markdown does not support specifying a language for inline code blocks.

nuanjanP commented 5 months ago

I apologize for my previously ill-defined question. What I'm meaning to ask is that, is there a non-standard syntax that can be used so that this plugin also targets a particular instance of inline code?

The reason I'm asking is because there are Obsidian plugins that use non-standard syntax to specify a language for inline code and then highlight it accordingly. For example,

However, these plugins don't use Shiki, so if this plugin supports inline code highlighting, that would be highly appreciated.

Thank you in advance for your answer.