Pandoc: numbering lines is no more working in 2.10.1 with higlighting

Created on 21 Aug 2020  Â·  8Comments  Â·  Source: jgm/pandoc

Since pandoc 2.10.1, line numbering using .numberLines on code chunk does not showa anymore when we use pandoc and its highlighting in rmarkdown. Specificity is that HTML templates are using boostrap.

The change with rmarkdown are reported here https://github.com/rstudio/rmarkdown/issues/1876, and I believe this could be a result of this commit in skylighting that remove a css rule https://github.com/jgm/skylighting/commit/7234122d64431e5f73af93637af1746c5f92ab07#diff-933373e2d607798b1a054eb67b03d682L173

in bootstrap files, we have this rule

pre {
  overflow: auto;
}

and that was overriden in previous pandoc version by this rule from skylighting

```css
.sourceCode { overflow: visible; } -- needed for line numbers
````
but it has been removed in the commit mentioned.

Is this an intended change in skylighting for pandoc ?

If so, then we will see to add this rule back in our template.

A reproducible example is the rmarkdown issue. If you need another one, please tell me I'll see what I can do.

All 8 comments

Thanks for pointing out the issue.
@dbaynard, who made this change in the skylighting CSS, may be able to comment further.

I'll go through the blame at the weekend — it's not immediately clear to me whether skylighting has invalid assumptions or whether overriding pre is something skylighting shouldn't have to consider.

Hitting this issue as well, any known workarounds?

You might try using --css and a file containing the line

.sourceCode { overflow: visible; }

@dbaynard have you been able to figure out the issue?

@jgm, I did try that, but unfortunately it "breaks" the border if scrolling is required:

break scroll

I'm no CSS expert, but AFAICT overflow: auto; is the only way to fix the border.

If you enter this feature again, please make sure it works well with screen readers. Until the previous version, when there was code with syntax highlighting, screen readers read a link before the line of code, for each one, and it was very annoying. Now it doesn't happen, and I suppose it's for this reason. Thanks!

Until the previous version, when there was code with syntax highlighting, screen readers read a link before the line of code, for each one, and it was very annoying. Now it doesn't happen, and I suppose it's for this reason. Thanks!

@brunoprietog I believe this is related to this change discussed in https://github.com/jgm/pandoc/issues/6352 and not the current issue.

I'll go through the blame at the weekend — it's not immediately clear to me whether skylighting has invalid assumptions or whether overriding pre is something skylighting shouldn't have to consider.

@dbaynard do you have news on this one ? It would be awesome a fix can be included for pandoc next version. Thank you.

@brunoprietog I believe this is related to this change discussed in #6352 and not the current issue.

@cderv You're absolutely right, I'm sorry

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elliottslaughter picture elliottslaughter  Â·  44Comments

anton-k picture anton-k  Â·  53Comments

matthijskooijman picture matthijskooijman  Â·  54Comments

jgm picture jgm  Â·  51Comments

GiantCrocodile picture GiantCrocodile  Â·  54Comments