Skip to content
Snippets Groups Projects
Commit 62af4ce5 authored by deuce's avatar deuce
Browse files

More fixes/refinements.

Boy, zero-width negative look-behind would be handy here... ie: (?<!
parent 5b38f674
No related branches found
No related tags found
No related merge requests found
...@@ -186,7 +186,7 @@ function make_links(str) { ...@@ -186,7 +186,7 @@ function make_links(str) {
str=str.replace(/(?:http|https|ftp|telnet|gopher|irc|news):\/\/[\w\-\.]+\.[a-zA-Z]+(?::[\w]*)?(?:\/(?:[\w\-._\?\,\/\\\+&amp;%\$#\=~\*]*))?/gi,function(str) { str=str.replace(/(?:http|https|ftp|telnet|gopher|irc|news):\/\/[\w\-\.]+\.[a-zA-Z]+(?::[\w]*)?(?:\/(?:[\w\-._\?\,\/\\\+&amp;%\$#\=~\*]*))?/gi,function(str) {
// | Protocol |Hostname | Path | // | Protocol |Hostname | Path |
var ret='<a href="'+str+'" target="_blank">'+str+'</a>'; var ret='<a href="'+str+'" target="_blank">'+str+'</a>';
var m=str.match(/^(.*)(&gt;|[^,.\(\)\s])$/); var m=str.match(/^(.*)(&gt;|[,.\)])$/);
if(m!=null) if(m!=null)
ret='<a href="'+m[1]+'" target="_blank">'+m[1]+'</a>'+m[2]; ret='<a href="'+m[1]+'" target="_blank">'+m[1]+'</a>'+m[2];
return(ret);} 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