-
Is there a way to do the highlighting of inline code blocks, denoted by a single pair of backticks For the general idea, see how Nextra, which uses Shiki for rendering code blocks and inline code, does it: https://nextra.site/docs/guide/syntax-highlighting#inlined-code |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Starlight uses Expressive Code for syntax highlighting of code blocks and to also extend formatting possibilities. For syntax highlighting of inline code expressions to be supported in Starlight, Expressive Code would need to support it. Based on this feature request, it looks like it's not something that's currently planned but you may want to check this issue for more details. |
Beta Was this translation helpful? Give feedback.
-
For the time being, I came up with an adhoc single-file Snippet:
|
Beta Was this translation helpful? Give feedback.
For the time being, I came up with an adhoc single-file
rehype
plugin that uses Shiki (like Expressive Code does) and highlights all inline code which uses following syntax:some code{:lang-name}
. The{:lang-name}
(for example,console.log(){:js}
) is also seen in Nextra docs and Rehype Pretty Code (didn't take it because it would conflict with Expressive Code).Snippet:
inline-code-highlighting.js
Here's the snippet: