See also r-lib/pkgdown#2436
In pkgdown we accidentally tried to interpolate fs paths into cli strings and that caused some bad link generation. I think it has something to do with the fs_path default theming? Notice how the blue output below isn't right.
library(cli)
library(fs)
testthat::local_reproducible_output(hyperlinks = TRUE)
path <- "~/Desktop/foo.R"
cli::cli_inform("{.run ['hi mom']({path})}")
#> �]8;;x-r-run:~/Desktop/foo.R�'hi mom'�]8;;�
path <- fs::path("~/Desktop/foo.R")
cli::cli_inform("{.run ['hi mom']({path})}")
#> �]8;;x-r-run:'�]8;;file:///Users/davis/Desktop/foo.R�~/Desktop/foo.R�]8;;�'�'hi mom'
# real example was more like this
# clicking the link should run `pkgdown::preview_page('~/Desktop/foo.R')`
path <- "~/Desktop/foo.R"
cli::cli_inform("{.run ['file.R'](pkgdown::preview_page('{path}'))}")
#> �]8;;x-r-run:pkgdown::preview_page('~/Desktop/foo.R')�'file.R'�]8;;�
# weirdness
path <- fs::path("~/Desktop/foo.R")
cli::cli_inform("{.run ['file.R'](pkgdown::preview_page('{path}'))}")
#> �]8;;x-r-run:pkgdown::preview_page(''�]8;;file:///Users/davis/Desktop/foo.R�~/Desktop/foo.R�]8;;�'')�'file.R'
Created on 2024-04-10 with reprex v2.0.2
See also r-lib/pkgdown#2436
In pkgdown we accidentally tried to interpolate fs paths into cli strings and that caused some bad link generation. I think it has something to do with the fs_path default theming? Notice how the blue output below isn't right.
Created on 2024-04-10 with reprex v2.0.2