Tension between wanting to use {.run }
over style_hyperlink()
but not wanting backticks in fallback mode
#684
Labels
bug
an unexpected problem or unintended behavior
In r-lib/pkgdown@52d696d we went from
style_hyperlink()
to the more ergonomic{.run }
syntax.Notice how in this case the text we show the user is not code, it is just some text that happens to run code behind the scenes. In fallback mode when we don't have hyperlink support, with
style_hyperlink()
this just showed the text as is, which worked quite well. Now with{.run }
it gets styled as{.code }
in fallback mode, which in practice adds backticks around the text (as seen in the snapshots) which is pretty odd.i.e. we went from
to
That was also an issue here r-lib/roxygen2#1604 where I wanted to switch to
{.run }
, but the thing we show the user is actually a path so naturally we wrap it in{.path }
too, i.e. it would end up like a nested{.path {.run [foo.R](code)}}
call. In fallback mode this gets super weird, we get single quotes from the.path
plus backticks from the.run
, so something like'`foo.R`'
Ideally in this scenario the fallback for
{.run }
would not have used{.code }
and would just show the text as is. However, I get that we often do show the user visible code, and that's what they click on, so the code fallback makes sense in that case (like therlang::last_trace()
hyperlink in error messages). Maybe we need a slightly different.run
variant or something?The text was updated successfully, but these errors were encountered: