mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Squire don't detect ftp links as browsers drop support
This commit is contained in:
parent
d10aec8f08
commit
77126d989a
1 changed files with 6 additions and 9 deletions
15
vendors/squire/build/squire-raw.js
vendored
15
vendors/squire/build/squire-raw.js
vendored
|
|
@ -1766,7 +1766,7 @@ const
|
||||||
return frag;
|
return frag;
|
||||||
},
|
},
|
||||||
|
|
||||||
linkRegExp = /\b(?:((?:(?:ht|f)tps?:\/\/|www\d{0,3}[.]|[a-z0-9][a-z0-9.-]*[.][a-z]{2,}\/)(?:[^\s()<>]+|\([^\s()<>]+\))+(?:[^\s?&`!()[\]{};:'".,<>«»“”‘’]|\([^\s()<>]+\)))|([\w\-.%+]+@(?:[\w-]+\.)+[a-z]{2,}\b(?:[?][^&?\s]+=[^\s?&`!()[\]{};:'".,<>«»“”‘’]+(?:&[^&?\s]+=[^\s?&`!()[\]{};:'".,<>«»“”‘’]+)*)?))/i,
|
linkRegExp = /\b(?:((https?:\/\/)?(?:www\d{0,3}\.|[a-z0-9][a-z0-9.-]*\.[a-z]{2,}\/)(?:[^\s()<>]+|\([^\s()<>]+\))+(?:[^\s?&`!()[\]{};:'".,<>«»“”‘’]|\([^\s()<>]+\)))|([\w\-.%+]+@(?:[\w-]+\.)+[a-z]{2,}\b(?:\?[^&?\s]+=[^\s?&`!()[\]{};:'".,<>«»“”‘’]+(?:&[^&?\s]+=[^\s?&`!()[\]{};:'".,<>«»“”‘’]+)*)?))/i,
|
||||||
|
|
||||||
addLinks = (frag, root) => {
|
addLinks = (frag, root) => {
|
||||||
let walker = createTreeWalker(frag, SHOW_TEXT, node => !getClosest(node, root, 'A'));
|
let walker = createTreeWalker(frag, SHOW_TEXT, node => !getClosest(node, root, 'A'));
|
||||||
|
|
@ -1781,14 +1781,11 @@ const
|
||||||
child = doc.createTextNode(data.slice(0, index));
|
child = doc.createTextNode(data.slice(0, index));
|
||||||
parent.insertBefore(child, node);
|
parent.insertBefore(child, node);
|
||||||
}
|
}
|
||||||
child = createElement('A', mergeObjects({
|
child = createElement('A', {
|
||||||
href: match[1] ?
|
href: match[1]
|
||||||
/^(?:ht|f)tps?:/i.test(match[1]) ?
|
? (match[2] ? match[1] : 'https://' + match[1])
|
||||||
match[1] :
|
: 'mailto:' + match[0]
|
||||||
'http://' + match[1] :
|
}, [data.slice(index, endIndex)]);
|
||||||
'mailto:' + match[0]
|
|
||||||
}, null, false));
|
|
||||||
child.textContent = data.slice(index, endIndex);
|
|
||||||
parent.insertBefore(child, node);
|
parent.insertBefore(child, node);
|
||||||
node.data = data = data.slice(endIndex);
|
node.data = data = data.slice(endIndex);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue