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
/
SWMan.pm
diff --git
a/perl/SWMan.pm
b/perl/SWMan.pm
index 23f0104addfef87e816c128534a32e0df5ef0d14..b27fca859fad4ab0b54f83e6e71900845f18bbc4 100644
(file)
--- a/
perl/SWMan.pm
+++ b/
perl/SWMan.pm
@@
-1,6
+1,6
@@
# -*-perl-*-
#
# -*-perl-*-
#
-# $Id: SWMan.pm,v 1.
1 1999/07/30 18:46:3
7 mdw Exp $
+# $Id: SWMan.pm,v 1.
2 1999/08/18 17:10:0
7 mdw Exp $
#
# Display and other fiddling of manual pages
#
#
# Display and other fiddling of manual pages
#
@@
-28,6
+28,9
@@
#----- Revision history -----------------------------------------------------
#
# $Log: SWMan.pm,v $
#----- Revision history -----------------------------------------------------
#
# $Log: SWMan.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.
#
@@
-288,18
+291,18
@@
sub man {
# --- And email and hypertext references too ---
$l =~ s! ((?:\<[bi]\>)*) # Leading highlighting
# --- And email and hypertext references too ---
$l =~ s! ((?:\<[bi]\>)*) # Leading highlighting
- ((?:http
|ftp)
# A protocol name
- :
//
# The important and obvious bit
+ ((?:http
s?|ftp|file|news)
# A protocol name
+ :
# The important and obvious bit
[^]&)\s]+ # Most characters are allowed
[^]&).,\s\'\"]) # Don't end on punctuation
((?:\</[bi]\>)*) # Closing tags, optional
[^]&)\s]+ # Most characters are allowed
[^]&).,\s\'\"]) # Don't end on punctuation
((?:\</[bi]\>)*) # Closing tags, optional
- !
<a href="$2">$&</a>
!gx;
+ !
$1<a href="$2">$&</a>$3
!gx;
- $l =~ s! ((?:\<[bi]\>)*)
- ( [^\s()&;
{}<>,.\`\"] [^\s()&;
{}<>\`\"]* \@
- [^\s()&;
{}<>\'\"]* [^\s()&;
{}<>.,\'\"])
+ $l =~ s! ((?:\<[bi]\>)*
(?:\bmailto:)?
)
+ ( [^\s()&;
:{}<>,.\`\"] [^\s()&;:
{}<>\`\"]* \@
+ [^\s()&;
:{}<>\'\"]* [^\s()&;:
{}<>.,\'\"])
((?:\</[bi]\>)*)
((?:\</[bi]\>)*)
- !
<a href="mailto:$2">$&</a>
!gx;
+ !
$1<a href="mailto:$2">$&</a>$3
!gx;
# --- Done! ---
# --- Done! ---