Skip to content

inline markup urls contain invisible invalid characters #757

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

Open
schochastics opened this issue Apr 11, 2025 · 2 comments
Open

inline markup urls contain invisible invalid characters #757

schochastics opened this issue Apr 11, 2025 · 2 comments
Labels
reprex needs a minimal reproducible example

Comments

@schochastics
Copy link

If a url is created as part of an alert (I assume this holds for all message types) via inline markup, there are additional "invisible" characters added to the string that make the url invalid.

library(cli)
test <- "path"
cli_alert("{.url https://example.com/{test}}")
#> → <https://example.com/path>

Image

In both cases you cannot see the invalid characters but when you click the link, it turns into https://example.com/%1B%5B3mpath%1B%5B3m in the browser.

Screenshot when clicking the link in Positron:
Image

@gaborcsardi
Copy link
Member

I cannot reproduce this in Positron. What's your Positron version and cli version?

@gaborcsardi gaborcsardi added the reprex needs a minimal reproducible example label Apr 25, 2025
@schochastics
Copy link
Author

OS

R version 4.4.2 (2024-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.4.1

Positron

Positron Version: 2025.05.0 (Universal) build 75
Code - OSS Version: 1.99.0
Commit: 6af5bd88e7ff43e833efd238a6a9bc077800059a
Date: 2025-04-22T03:29:14.910Z
Electron: 34.3.2
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.4.0

cli

packageVersion("cli")
#> ‘3.6.5’

The example above still produces the wrong url for me. The issue also occurred in RStudio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants