Open pat-s opened 2 years ago
Can you please provide a reprex using a package that's on CRAN?
Reprex using mlr3 from CRAN, which I suspect is one of the reasons Patrick encountered this behavior:
library(downlit)
library(mlr3)
# Object in question: mlr3::Task
downlit::highlight("mlr3::Task$new()")
#> [1] "<span><span class='nf'>mlr3</span><span class='nf'>::</span><span class='nv'><a href='https://mlr3.mlr-org.com/reference/Task.html'>Task</a></span><span class='o'>$</span><span class='nf'>new</span><span class='o'>(</span><span class='o'>)</span></span>"
downlit::highlight("mlr3::Task")
#> [1] "<span><span class='nf'>mlr3</span><span class='nf'>::</span><span class='nv'><a href='https://mlr3.mlr-org.com/reference/Task.html'>Task</a></span></span>"
downlit::highlight("Task$new()")
#> [1] "<span><span class='nv'>Task</span><span class='o'>$</span><span class='nf'>new</span><span class='o'>(</span><span class='o'>)</span></span>"
downlit::highlight("Task")
#> [1] "<span><span class='nv'>Task</span></span>"
Created on 2022-09-14 with reprex v2.0.2
The following works
The following do not
I've played around a bit with
downlit::highlight()
and found thatdoes not include the
href
part becausepackages
inhttps://github.com/r-lib/downlit/blob/main/R/highlight.R#L58
is empty. I've added the following to a fork
which makes the
href
part getting added todownlit::highlight("<class>$new()")
when executed directly. However, I still do not get highlighting when building a pkgdown site 🤔 (new session, fresh start with modified {downlit}).Is there something else I am overlooking which is responsible for highlighting of local packages in {pkgdown}?