Is anyone else seeing this problem? When I remove the “yaml” directive on the first line, it renders as a normal code-block but it can’t detect that it’s YAML.
I though the same thing as you, but I do see that YAML is listed in the highlight.js demo page (choose ‘Config’ in the left hand side menu. YAML is at the bottom in that category.)
But other than that, we’ll indeed have to see the Hugo code to figure this one out (if it’s a Hugo problem at all).
I think this means Hugo’s default code highlighter choice for posts is not great.
I’ve used static site generators Jekyll (ruby) and Pelican (python) before and both supported the ```yaml syntax out of the box just fine.
I think Hugo should do better here. YAML is a fairly common language in blog posts etc.
(I’ve tried mitigating this problem by using {{<highlight yaml>}} shortcode, however since I use other shortcodes within my code blocks, for some reason, nesting did not work and the inner shortcode was rendered as-is.)
@bep Apologies if I’m getting this wrong. When I use triple-backtick syntax in my markdown posts, the resulting <pre> tag is not getting any special treatment by Chroma.
Chroma seems to be working only when I use the {{<highlight}} shortcode. (The contents of the <pre> tag is processed heavily.)
Here is a screenshot illustrating the problem (this is the “kiss” theme):
Note that I do not intend to use the {{<highlight}} shortcode as it will not render correctly on GitHub markdown and is not portable to other blogging platforms. I need the triple-backtick syntax to work.
Was wondering… Should pygmentsCodeFences and other pygments* variables that apply to Chroma too be deprecated (may be obsoleted in about a year or so?), and be replaced with generic names that refer to neither pygments nor Chroma?
Something like highlightCodeFences or syntaxhlCodeFences?