inline markup urls contain invisible invalid characters

Open
#757 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
cli

Research direction

Start by reproducing the cli_alert() inline-markup example with a substituted URL path, then inspect the generated link for the invisible escape characters shown in the issue. Done means the rendered URL remains valid and does not encode those characters when clicked; no specific source file or test is named in the issue.

Written by the indexing model from the issue text.

Description

reprex

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

Dominant language
R
Stars
726
Forks
94
Avg merge
3h 35m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from r-lib/cli

All issues in r-lib/cli

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.