0
votes

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.

1
That sounds strange. I advise you to add a Gemfile file with the following content gem 'github-pages' and run bundle install. Now you should have the same gems as on Github Pages and see if it works.Alex Palcuie
I should have also added, that I already installed the github-pages gem, which installed the 3.0.3 version of jekyll. That also did not help.Nachtfunke
Well, the first syntax is the one for Pygments, so my hunch is that you may have messed up your gems. Can you run bundle exec jekyll serve just to be sure jekyll runs with the correct gems? Or can you isolate those gems in a fresh environment using rvm or rbenv?Alex Palcuie
Installing bundler and executing bundle exec jekyll serve tells me Could not locate Gemfile or .bundle/ directory. Im just a Frontend Designer and I know just enough to get my tools working with the commandline, so I have unfortunately no idea what you mean by > can you isolate those gems in a fresh environment using rvm or rbenv?Nachtfunke

1 Answers

2
votes

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

Replace

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

by

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