I am using github pages to host my blog. It uses GitHub Flaword Markdown. Here is part of
_config.yml
markdown: kramdown
# Use Github Flavored Markdown
kramdown:
input: GFM
<pre>
white-space: pre-wrap
Sorry, but wrapping long lines in code highlight doesn't work with line numbers.
{% highlight ruby linenos %}
def dosomething
delegate :some, :thing, :with, :unicorns, :and, :shrimps => :yolo, :someother key => true, :maybeonemore => true
end
{% endhighlight %}
See Jekyll documentation.
And CSS wrapping for long lines :
.highlight pre{
white-space: pre-wrap;
}
But finally this problem cannot be resolved with just jekyll or kramdown/rouge config.
This, because, line numbers are stacked in a <td>
near the code <td>
.
If you can wrap code, line numbers are not wrapping accordingly, and it ends up like this :
def foo
1 wrapped very long line
2 wrapped very long line continues here
3
end