scinote-web/app/assets/javascripts/sitewide/quill_links.js

23 lines
529 B
JavaScript
Raw Normal View History

// Globally overwrite links handling in Quill rich text editor
2017-01-19 05:40:08 +08:00
// var Link = Quill.import('formats/link');
// Link.sanitize = function(url) {
// if (url.includes('http:') || url.includes('https:')) {
// return url;
// }
// return 'http://' + url;
// };
//
// function openLinksInNewTab() {
// _.each($('.ql-editor a'), function(el) {
// if ($(el).attr('target') !== '_blank') {
// $(el).attr('target', '_blank');
// }
// });
// }
//
// $(document).ready(function(){
// openLinksInNewTab();
// });