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

Most users don't know about adding https:// before their urls. We should assume that many will freehand a url and omit the https:// #632

Closed
jurisjansons opened this issue Jul 8, 2020 · 4 comments

Comments

@jurisjansons
Copy link

Most users don't know about adding https:// before their urls. We should assume that many will freehand a url and omit the https:// thoughts on opening a ticket to resolve this issue?

Originally posted by @FrederickEngelhardt in #529 (comment)

@jurisjansons jurisjansons changed the title Most users don't know about adding https:// before their urls. We should assume that many will freehand a url and omit the https:// thoughts on opening a ticket to resolve this issue? Most users don't know about adding https:// before their urls. We should assume that many will freehand a url and omit the https:// Jul 8, 2020
@zenoamaro
Copy link
Owner

This is a behavior of the Quill editor. While I agree with your suggestions, I can't implement them in ReactQuill. Please open a ticket here: https://github.com/quilljs/quill/issues

@heyalexchoi
Copy link

@jurisjansons
you can prepend http scheme to urls for your users:

import Quill from 'quill'
const Link = Quill.import('formats/link');
Link.sanitize = function(url) {
  // quill by default creates relative links if scheme is missing.
  if (!url.startsWith('http://') && !url.startsWith('https://')) {
    return `http://${url}`
  }
  return url;
}

@Puspendert
Copy link

@heyalexchoi that means I need to add an extra dependency(quill) to the project and make the bundle size more heavy?

@alexkrolick
Copy link
Collaborator

@Puspendert Quill is a dependency of React-Quill already

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

5 participants