0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Add <a> for ftp:// links on paste.

This commit is contained in:
Neil Jenkins 2013-01-15 10:34:03 +11:00
parent bce3e8d208
commit 8b2090c94e
2 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -940,7 +940,7 @@
// --- Clean ---
var linkRegExp = /\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\([^\s()<>]+\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])|(?:[\w\-.%+]+@(?:[\w\-]+\.)+[A-Z]{2,4}))/i;
var linkRegExp = /\b((?:(?:ht|f)tps?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\([^\s()<>]+\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])|(?:[\w\-.%+]+@(?:[\w\-]+\.)+[A-Z]{2,4}))/i;
var addLinks = function ( frag ) {
var doc = frag.ownerDocument,
@ -962,7 +962,7 @@
node = doc.createElement( 'A' );
node.textContent = text;
node.href = /@/.test( text ) ? 'mailto:' + text :
/^https?:/.test( text ) ?
/^(?:ht|f)tps?:/.test( text ) ?
text : 'http://' + text;
} else {
node = doc.createTextNode( text );