chiark
/
gitweb
/
~mdw
/
sw-tools
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Slight improvements to URL and email address parsing.
[sw-tools]
/
perl
/
SWDoc.pm
diff --git
a/perl/SWDoc.pm
b/perl/SWDoc.pm
index d87da58c91d817da853495640a7358875abefcf5..d519b11257d5de678d79794e937241c225d6a6e4 100644
(file)
--- a/
perl/SWDoc.pm
+++ b/
perl/SWDoc.pm
@@
-1,6
+1,6
@@
# -*-perl-*-
#
# -*-perl-*-
#
-# $Id: SWDoc.pm,v 1.
1 1999/07/30 18:46:3
7 mdw Exp $
+# $Id: SWDoc.pm,v 1.
2 1999/08/18 17:10:0
7 mdw Exp $
#
# Display documentation files
#
#
# Display documentation files
#
@@
-28,6
+28,9
@@
#----- Revision history -----------------------------------------------------
#
# $Log: SWDoc.pm,v $
#----- 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.
#
# 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/\&/&/g;
$line =~ s/\</</g;
$line =~ s/\>/>/g;
- $line =~ s!
(http|ftp)://
[^]&)\s]*[^]&).,\s\']!<a href="$&">$&</a>!g;
+ $line =~ s!
\b(https?|ftp|file|news):
[^]&)\s]*[^]&).,\s\']!<a href="$&">$&</a>!g;
$line =~ s!info:([^]&)\s]*[^]&).,\s\'\"])!<a href="$ref?act=info&file=$1&node=Top">$&</a>!g;
$line =~ s!info:([^]&)\s]*[^]&).,\s\'\"])!<a href="$ref?act=info&file=$1&node=Top">$&</a>!g;
- $line =~ s!
[^\s()&;{}.,\`\"][^\s()&;{}\`\"]*\@[^\s()&;{}\'\"]*[^\s()&;{}.,\'\"]!<a href="mailto:$&
">$&</a>!g;
+ $line =~ s!
(?:\bmailto:)?([^\s()&;:{}.,\`\"][^\s()&;:{}\`\"]*\@[^\s()&;:{}\'\"]*[^\s()&;:{}.,\'\"])!<a href="mailto:$1
">$&</a>!g;
$line =~ s!([-_.\w]+)\((\d+\w*)\)!SWMan::subst("$1($2)", $1, $2)!eg;
print $line;
}
$line =~ s!([-_.\w]+)\((\d+\w*)\)!SWMan::subst("$1($2)", $1, $2)!eg;
print $line;
}