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

Hyperlink with ‘beacon://’ do not work #2876

Closed
HuangDaWei-fs opened this issue Dec 19, 2019 · 2 comments
Closed

Hyperlink with ‘beacon://’ do not work #2876

HuangDaWei-fs opened this issue Dec 19, 2019 · 2 comments

Comments

@HuangDaWei-fs
Copy link

HuangDaWei-fs commented Dec 19, 2019

Steps for Reproduction

  1. select link.
  2. enter value with ‘beacon://xxx’
  3. click save

Expected behavior:
hyperlink's value should be 'beaco://xxx'

<a href="beacon://xxx" target="_blank">some text</a>

Actual behavior:
hyperlink's value was 'about:blank'

<a href="about:blank" target="_blank">some text</a>

Platforms:
chrome

Version:
version of quill.js is 1.3.6

@padraigfl
Copy link

By default I believe all links are relative if they don't begin with http, what you need to do is import and update the sanitize function in the Link format

Untested but the following may work

    const Link = Quill.import('formats/link');
    Link.sanitize = url => url;

@HuangDaWei-fs
Copy link
Author

By default I believe all links are relative if they don't begin with http, what you need to do is import and update the sanitize function in the Link format

Untested but the following may work

    const Link = Quill.import('formats/link');
    Link.sanitize = url => url;

I found a variable in source code in quill.js named PROTOCOL_WHITELIST

Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];

there is no 'beacon', so i add 'beacon' to it, it works

Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel', 'beacon'];

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

2 participants