Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to highlight Markdown code in Jekyll?

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.

like image 524
mehdix Avatar asked May 20 '26 18:05

mehdix


2 Answers

You can use Rouge or Coderay for this purpose.

like image 52
Zombo Avatar answered May 25 '26 16:05

Zombo


You could use something like this:

```markdown
{% raw %}{% if page.tags %}...{% endif %}{% endraw %}
```
like image 24
Gunith D Avatar answered May 25 '26 14:05

Gunith D