X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sw-tools/blobdiff_plain/9abee809f51da26598bf24572d9b14fa13a455bd..44b3c5890c87bc795256cd75bdd32d4279336aa9:/perl/SWDoc.pm
diff --git a/perl/SWDoc.pm b/perl/SWDoc.pm
index d87da58..d519b11 100644
--- a/perl/SWDoc.pm
+++ b/perl/SWDoc.pm
@@ -1,6 +1,6 @@
# -*-perl-*-
#
-# $Id: SWDoc.pm,v 1.1 1999/07/30 18:46:37 mdw Exp $
+# $Id: SWDoc.pm,v 1.2 1999/08/18 17:10:07 mdw Exp $
#
# Display documentation files
#
@@ -28,6 +28,9 @@
#----- Revision history -----------------------------------------------------
#
# $Log: SWDoc.pm,v $
+# Revision 1.2 1999/08/18 17:10:07 mdw
+# Slight improvements to URL and email address parsing.
+#
# Revision 1.1 1999/07/30 18:46:37 mdw
# New CGI script for browsing installed software and documentation.
#
@@ -58,9 +61,9 @@ sub doc {
$line =~ s/\&/&/g;
$line =~ s/\</g;
$line =~ s/\>/>/g;
- $line =~ s!(http|ftp)://[^]&)\s]*[^]&).,\s\']!$&!g;
+ $line =~ s!\b(https?|ftp|file|news):[^]&)\s]*[^]&).,\s\']!$&!g;
$line =~ s!info:([^]&)\s]*[^]&).,\s\'\"])!$&!g;
- $line =~ s![^\s()&;{}.,\`\"][^\s()&;{}\`\"]*\@[^\s()&;{}\'\"]*[^\s()&;{}.,\'\"]!$&!g;
+ $line =~ s!(?:\bmailto:)?([^\s()&;:{}.,\`\"][^\s()&;:{}\`\"]*\@[^\s()&;:{}\'\"]*[^\s()&;:{}.,\'\"])!$&!g;
$line =~ s!([-_.\w]+)\((\d+\w*)\)!SWMan::subst("$1($2)", $1, $2)!eg;
print $line;
}