tibble icon indicating copy to clipboard operation
tibble copied to clipboard

clickable url issues

Open moodymudskipper opened this issue 1 month ago • 1 comments

The url used when we click on a link is the shortened url instead of the data url when width isn't sufficient

run locally and click to reproduce:

print(tibble::tibble(a="https://tibble.tidyverse.org"), width = 20)
#> # A tibble: 1 × 1
#>   a                 
#>   <chr>             
#> 1 https://tibble.ti…

Created on 2025-11-28 with reprex v2.1.0

Moreover, it seems that only 1 url per row is clickable:

tibble::tibble(
  a = c("https://tibble.tidyverse.org", "https://www.google.com", "a"), 
  b = c( "https://www.google.com", "https://tibble.tidyverse.org", "https://tibble.tidyverse.org")
)
#> # A tibble: 3 × 2
#>   a                            b                           
#>   <chr>                        <chr>                       
#> 1 https://tibble.tidyverse.org https://www.google.com      
#> 2 https://www.google.com       https://tibble.tidyverse.org
#> 3 a                            https://tibble.tidyverse.org

Created on 2025-11-28 with reprex v2.1.0

moodymudskipper avatar Nov 28 '25 11:11 moodymudskipper

To fix this, we'd need a class for strings that contain URLs. I don't find one in https://github.com/krlmlr/awesome-vctrs/, but perhaps there is one?

We could then use link texts for shortened URLs: https://cli.r-lib.org/reference/links.html#link-text-1 .

krlmlr avatar Nov 28 '25 11:11 krlmlr