Syntax highlighting works great provided I don’t request line numbers to be shown.
I’m working with hugo-book theme, inserting code with code fences (three backticks),
and controlling line number display either in hugo.toml or in the doc file by
inserting after the language name {linenos = true}.
When line numbers are displayed they are offset vertically from the code lines by a small amount. I have tried many CSS fixes suggested by ChatGPT, but none of them makes any difference.
There is only one scenario where the line numbers are properly aligned: set pygmentsUseClasses = true, and do not supply the corresponding CSS color maps. In this case there is perfect alignment, but there is no color (black and white). The explanation appears to be that only in this case is the same monospace font used for line numbers and code.
Thanks for posting the issue in hugo-book github repo. I tested with a few other themes and found another where the problem appears: simplog theme. The problem does not appear in several other themes that I tested, so there is something peculiar about these two that leads to the problem.
I’m not sure what you mean by displaying line numbers inline, hl_inline = true?