AlwaysQuestioning
AlwaysQuestioning

Reputation: 1484

How can I change the default tab size in highlighted code in Jekyll 3.0?

If I did:

{% highlight C %}
    .... code
{% endhighlight %}

For any tab I use between the highlighted C, I'd like the tab size to be 2 rather than 4. Doing {% highlight C tabsize=2 %} doesn't seem to work in Jekyll 3.

The answers I have seen on SO seem to work for older versions, but not recent versions.

Upvotes: 6

Views: 1273

Answers (1)

Shadowfacts
Shadowfacts

Reputation: 1053

I don't believe it's possible from Jekyll itself, but you can accomplish this with CSS using the tab-size attribute:

pre {
    tab-size: 2;
}

Upvotes: 10

Related Questions