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

Tel link doesn't work Link Plugin #3230

Open
espipj opened this issue May 29, 2024 · 2 comments
Open

Tel link doesn't work Link Plugin #3230

espipj opened this issue May 29, 2024 · 2 comments
Labels
bug Something isn't working plugin:link

Comments

@espipj
Copy link

espipj commented May 29, 2024

Description

As of now tel: links doesn't work either but they're are included under default "allowedSchemas" here so sanitizeUrl will never run.

Related PR: #2444

Steps to Reproduce

Create a link in the editor using "tel:123456"

Expected Behavior

Link gets created if "tel" is under "allowedSchemas" (there by default)

Environment

  • slate:
  • slate-react:
  • browser: chrome

Bounty

Click here to add a bounty via Algora.

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar
@espipj espipj added the bug Something isn't working label May 29, 2024
@12joan
Copy link
Collaborator

12joan commented May 29, 2024

It looks like the problem is that the default isUrl helper returns false for a correctly formatted tel: URL. If you could patch that helper to add tel: as a special case, that should resolve the issue, I think.

Changing isUrl to return true for anything that can be parsed with new URL(...) probably isn't what we want, since this would result in false positives when pasting strings containing colons. new URL('hello:world') // parses successfully

@espipj
Copy link
Author

espipj commented May 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin:link
Projects
None yet
Development

No branches or pull requests

2 participants