Skip to content
Snippets Groups Projects
Commit 5b38f674 authored by deuce's avatar deuce
Browse files

Attempt to conform the the RuneMaster URI spec.

parent b224d8f2
No related branches found
No related tags found
No related merge requests found
......@@ -183,9 +183,10 @@ function idx_to_user(fromidx)
}
function make_links(str) {
str=str.replace(/(?:http|https|ftp|telnet|gopher|irc|news)\:\/\/[\w\-\.]+\.[a-zA-Z]+(?::[\w]*)?(?:\/(?:[\w\-._\?\,\/\\\+&%\$#\=~\*]*))?[^,.\(\)\s]/gi,function(str) {
str=str.replace(/(?:http|https|ftp|telnet|gopher|irc|news):\/\/[\w\-\.]+\.[a-zA-Z]+(?::[\w]*)?(?:\/(?:[\w\-._\?\,\/\\\+&%\$#\=~\*]*))?/gi,function(str) {
// | Protocol |Hostname | Path |
var ret='<a href="'+str+'" target="_blank">'+str+'</a>';
var m=str.match(/^(.*)(&gt;.*)$/);
var m=str.match(/^(.*)(&gt;|[^,.\(\)\s])$/);
if(m!=null)
ret='<a href="'+m[1]+'" target="_blank">'+m[1]+'</a>'+m[2];
return(ret);}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment