3

I want to highlight markdown code in jekyll but I can't find a way how to do it. I looked at Pygement's lexers but I did not found one for markdown or kramdown.

I can highlight other codes but not markdown and kramdawn.

mehdix
  • 4,984
  • 1
  • 28
  • 36
  • Possible duplicate of [Syntax highlighting in jekyll using redcarpet](https://stackoverflow.com/questions/27366095/syntax-highlighting-in-jekyll-using-redcarpet) – Innat Jul 08 '18 at 12:05

2 Answers2

1

You can use Rouge or Coderay for this purpose.

Zombo
  • 1
  • 62
  • 391
  • 407
  • Your answer was the starting point, then it took a long way to actually make it work! :) I realized that kramdown applies coderay by default I only needed to build it locally and push the buid to github pages or my own host. – mehdix Dec 23 '14 at 12:24
1

You could use something like this:

```markdown
{% raw %}{% if page.tags %}...{% endif %}{% endraw %}
```
Gunith D
  • 1,843
  • 1
  • 31
  • 36