0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-03 13:16:31 -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 --- // --- 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 addLinks = function ( frag ) {
var doc = frag.ownerDocument, var doc = frag.ownerDocument,
@ -962,7 +962,7 @@
node = doc.createElement( 'A' ); node = doc.createElement( 'A' );
node.textContent = text; node.textContent = text;
node.href = /@/.test( text ) ? 'mailto:' + text : node.href = /@/.test( text ) ? 'mailto:' + text :
/^https?:/.test( text ) ? /^(?:ht|f)tps?:/.test( text ) ?
text : 'http://' + text; text : 'http://' + text;
} else { } else {
node = doc.createTextNode( text ); node = doc.createTextNode( text );