Search code examples
jekyllsyntax-highlightingkramdownrouge

Jekyll: kramdown ignoring input in _config.yml


I am trying to make syntax highlighting on my jekyll site work with the syntax for syntax highlighting that is also supported by github. Currently, I use this syntax to highlight my code:

{% highlight css %}
/* code */
{% endhighlight %}

Which does work fine on my site, but is not working on github. Instead, I need it to work with this supported syntax:

´´´ css
/* code */
´´´

It is a requirement that the syntax is also being highlighted on github. So I found this blogpost and followed it along. But it is not working. I don't get any errors, this part is just not interpreted by kramdown and is instead just turned into a <p>.

I tried installing an older version of jekyll 3.0 which also did not make any difference. I googled the problem and found many people having the same issues, but they got turned down rather fiercely by the people on github which is the reason why I am asking the question here instead of opening an issue on github. They say that this is a known bug resolved in 3.1, but I have 3.1.2 and it is not resolved for me.

I have also installed the rouge and kramdown gems (1.10.1 and 1.10). I believe, that jekyll just straight up ignores these settings in my _config.yml:

markdown: kramdown

kramdown:
  input: GFM
  syntax_highlighter: rouge

If anyone could maybe help on this, that would be great.


Solution

  • You're using ACUTE ACCENT &#180; instead of GRAVE ACCENT &#96;

    Replace

    ´´´ css
    /* code */
    ´´´
    

    by

    ``` css
    /* code */
    ```