Skip to content
Snippets Groups Projects
Commit 92dc23f5 authored by deuce's avatar deuce
Browse files

Bah, if your URI is more than 80 chars, use tinyurl or whatever.

parent b84e511b
No related branches found
No related tags found
No related merge requests found
......@@ -183,16 +183,11 @@ function idx_to_user(fromidx)
}
function make_links(str) {
str=str.replace(/(?:http|https|ftp|telnet|gopher|irc|news):\/\/[\w\-\.]+\.[a-zA-Z]+(?::[\w-+_%]*)?(?:\/(?:[\r\n\w\-._\?\,\/\\\+&;%\$#\=~\*]*))?/gi,function(str) {
str=str.replace(/(?:http|https|ftp|telnet|gopher|irc|news):\/\/[\w\-\.]+\.[a-zA-Z]+(?::[\w-+_%]*)?(?:\/(?:[\w\-._\?\,\/\\\+&;%\$#\=~\*]*))?/gi,function(str) {
// | Protocol |Hostname |TLD | Port | Path allow line breaks in path (will be stripped)
var text=str;
var uri=str;
var extra='';
var m=str.match(/^([\x00-\xff]*?)((?:\r?\n\r?\n).*)$/)
if(m!=null) {
str=m[1];
extra=m[2];
}
m=str.match(/^([\x00-\xff]*?)((?:>|[\r\n,.\)])+)$/);
if(m!=null) {
text=m[1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment