Skip to content
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

Clickable links including "zero width space" in URL #18

Open
Soviut opened this issue Feb 16, 2022 · 2 comments
Open

Clickable links including "zero width space" in URL #18

Soviut opened this issue Feb 16, 2022 · 2 comments

Comments

@Soviut
Copy link

Soviut commented Feb 16, 2022

I've already reported this issue on the Netlify CLI repo netlify/cli#4311

I'm using VSCode and am working on a project that uses the Netlify CLI. They print out the URLs to the serverless functions as they're loaded. These URLs include a "zero width space" (U+200B).

◈ Loaded function api (​http://localhost:8888/.netlify/functions/api​).
◈ Loaded function render (​http://localhost:8888/.netlify/functions/render​).

Clicking those links in the VSCode terminal includes the zero width space, producing URLs that look like

http://localhost:8888/.netlify/functions/api%E2%80%8B

I know there is a fallback that adds the character for unsupported terminals. VSCode isn't specifically on the support list, but it can also use lots of different terminals so it may be listed as one of them. Even if none are supported, VSCode's terminal seems to make any URL-like string clickable, for example:

image

I'm curious if it would be safe for me to write a PR for the Netlify CLI that turns it off or returns a normal space?

@kbrandwijk
Copy link

We have observed this same behavior in Github Action logs, the URL is displayed in fallback mode (text (url)) but the URL when clicked includes the zero width space.

@jackiewmacharia
Copy link

Defining a fallback function is a possible workaround for this e.g. terminalLink(text, url, { fallback: () => `${text} ${url}` })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants