Line numbers could not be displayed if both lineno and hl_lines enabled in code fence

If both lineno and hl_lines are enabled in code fence, like this

image

Then, the line numbers could not be displayed,


I found the root cause is the display:grid setting in style, if it is deleted, everything goes well, like this



hugo version: v0.122.0

highlight setting is as this:

[markup.highlight]
anchorLineNos = false
codeFences = true
guessSyntax = false
hl_Lines = “”
lineAnchors = ‘’
lineNoStart = 1
lineNos = false
lineNumbersInTable = true
noClasses = true
noHl = false
style = “pygments”
tabWidth = 4

This is probably caused by some conflicting CSS in your site or theme.

On a site with no stylesheets, this:

```python {linenos=true,hl_lines=[3],style=pygments}
for i in range(2, num):
    if (num % i) == 0:
        # if factor is found, set flag to True
        flag = True
        # break out of loop
        break
```

Is rendered to this:

image

Yes, I’m using old Academic theme, and made some modifications.

It seem there are many diffences between the html generated by that theme and Hugo tut pages.

That theme use its own code highlighter instead of Hugo’s chroma.

How to config that theme to use chroma?

Thanks.

That’s a question for the theme’s author.