My website was put together using Jekyll, specifically with the Beatiful-Jekyll theme. To make syntax highlighting possible, I utilized Rouge. The issue arises when displaying line numbers alongside the code - sometimes they don't align properly or are missing at the beginning or end.
One example where everything is in order can be seen here:
In this scenario, the line numbers match up with the code lines but the first and last ones are absent (or the first three and last three).
The final case shows a lack of alignment between line numbers and code lines:
I suspect the issue lies with the linenos tag. My attempt to fix this involved configuring the _config.yml file as follows:
kramdown:
input: GFM
syntax_highlighter: rouge
syntax_highlighter_opts:
css_class: 'highlight'
span:
line_numbers: false
block:
line_numbers: true
start_line: 1
Although this setting correctly displays default line numbers, those shown while using {% highlight linenos %} remain problematic.
default_line_numbering_without_linenos
Any guidance on resolving this issue would be greatly appreciated. Thank you.