-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to harden the formatting of URLs? (issue with #
encoding)
#357
Comments
It's the cli::cli_alert(sprintf(
fmt = "Downloading {.url %s}.",
gsub(
pattern = "#",
replacement = "",
x = url,
fixed = TRUE
)
))
## → Downloading <https://docs.google.com/spreadsheets/d/1U6Cf_qEOhiR9AZqTqS3mbMF3zt2db48ZP5v3rkrAEJY/editgid=780868077>.
cli::cli_alert(sprintf(
fmt = "Downloading {.url %s}.",
gsub(
pattern = "#",
replacement = "\\#",
x = url,
fixed = TRUE
)
))
## → Downloading |
#
encoding)
Here's a simpler reprex that's the main issue: cli::cli_alert("#")
## → #
cli::cli_alert("{.val #}")
## → |
This is a bug in glue: tidyverse/glue#224 But you don't need url <- "https://docs.google.com/spreadsheets/d/1U6Cf_qEOhiR9AZqTqS3mbMF3zt2db48ZP5v3rkrAEJY/edit#gid=780868077"
cli::cli_alert("Downloading {.url {url}}.")
|
This is now "fixed" in dev glue, but unterminated I am closing this now. |
I came across an edge case where some URLs are not rendering as expected.
Here's a minimal reprex:
Is there a way to harden the encoding of URLs to work better with the cli package?
The text was updated successfully, but these errors were encountered: