r-lib / cli

Tools for making beautiful & useful command line interfaces
https://cli.r-lib.org/
Other
655 stars 70 forks source link

link text for files does not display properly with `fs_path` objects #714

Open zkamvar opened 3 months ago

zkamvar commented 3 months ago

If I pass output from {fs} into link text, the actual link still shows up in the output:

path <- fs::path("a/b")
# with fs_path object
cli::cli_text("go to {.href [c](file://{path})}")
#> go to a/bc
#
# with character
cli::cli_text("go to {.href [c](file://{unclass(path)})}")
#> go to c

FWIW, this is what the output of reprex looks like:

path <- fs::path("a/b")
# with fs_path object
cli::cli_text("go to {.href [c](file://{path})}")
#> go to c (<file://'a/b'>)
cli::cli_text("go to {.href [c](file://{unclass(path)})}")
#
# with character
#> go to c (<file://a/b>)

Created on 2024-08-09 with reprex v2.1.1