Search code examples
jekyllprismjs

Single-backtick inline code block in jekyll, picking language


Jekyll supports single-backtick inline code: something like `std::vector<int> v;` gets rendered as <code>std::vector&lt;int&gt; v;</code>.

Is it possible to add something more to that? Is there a configuration I can do to make it render as <code class="language-cpp">std::vector&lt;int&gt; v;</code>? The syntax highlighter I use (Prism) doesn't get activated for the single backtick blocks - only for those which the specified language class.


Solution

  • You can use kramdown block attributes like this :

    `std::vector<int> v;`{:.CSSClass}