Quill: Link format automatically adds 'http://'

Created on 26 Nov 2014  路  4Comments  路  Source: quilljs/quill

I'm referring to this:
https://github.com/quilljs/quill/blob/develop/src/modules/link-tooltip.coffee#L88

Since my app runs on multiple domains, I'd like to be able to link to "/something/somethingelse", without http://mydomain.com.

How can I customize it withouth editing quill's source?

feature

Most helpful comment

Quill no longer adds the https:// and actually defaults to relative URLs but you can also customize this in the 1.0 beta:

var Link = Quill.import('formats/link');
Link.sanitize = function(url) {
  // modify url if desired
  return url;
}

All 4 comments

This is not currently configurable. I'll add this as a feature request.

This is a feature that I would definitely like to see added.

Also - I want to set links to default to open in a new window, but had hoped I wouldn't have to edit source. I'd also request that this be turned into a module so that we could modify it if need be.

Quill no longer adds the https:// and actually defaults to relative URLs but you can also customize this in the 1.0 beta:

var Link = Quill.import('formats/link');
Link.sanitize = function(url) {
  // modify url if desired
  return url;
}
Was this page helpful?
0 / 5 - 0 ratings