Better heuristic for finding URLs in plain text.
This commit is contained in:
parent
003d08b526
commit
de5352928d
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=4101
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
|||
#
|
||||
# url.cgi - make plain text URLs clickable
|
||||
#
|
||||
# $Id: url.cgi,v 1.13 1999-01-19 17:07:03 wosch Exp $
|
||||
# $Id: url.cgi,v 1.14 1999-01-22 23:57:55 wosch Exp $
|
||||
|
||||
|
||||
$hsty_base = '';
|
||||
|
@ -59,7 +59,7 @@ print "\n<HR>\n<pre>\n";
|
|||
my($content);
|
||||
$content .= $_ while(<CO>);
|
||||
$content =~ s/</</g;
|
||||
$content =~ s%((http|ftp)://[^\s"\)\>,;]+)%<A HREF="$1">$1</A>%gi;
|
||||
$content =~ s%((http|ftp)://\S+[^.;,"\s>])%<A HREF="$1">$1</A>%gi;
|
||||
|
||||
print $content;
|
||||
print "</pre>\n";
|
||||
|
|
Loading…
Reference in a new issue