downlit_html_*
should support Pandoc's document with numbered line
#133
Labels
feature
a feature request or enhancement
Pandoc allows to add number lined in code chunk by adding the class
.number-lines
to code chunk. This can be done in R Markdown usingclass.source
knitr option, but is also possible in Quarto withcode-line-numbers = true
options. In Quarto this is also the default for revealjs format.Trying to activate downlit for those (using
highlight_downlit: true
in Rmd orcode-link: true
in Quarto) will not apply the highlighting or the code linking.Quarto example
Rmd example
Both are using
downlit::downlit_html_path()
on the result of Pandoc conversion.This is due to two things mainly
<pre>
will have more classes like<pre class="sourceCode numberSource r number-lines">
and detection does not account for thatdownlit/R/downlit-html.R
Lines 47 to 48 in 8ee71d8
Number per line is done by Pandoc highlighting through the addition of spans like
<span id="cb1-1"><a href="#cb1-1"></a>
HTML from example above:
downlit is replacing all the the
<pre>
and it would require here to preserve the span at each line.Opening this issue to document this limitation and to discuss how to handle that. Happy to help on this as this is needed for Quarto
code-link
to work in presentation where line numbers is the default currently.The text was updated successfully, but these errors were encountered: