X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sw-tools/blobdiff_plain/9abee809f51da26598bf24572d9b14fa13a455bd..44b3c5890c87bc795256cd75bdd32d4279336aa9:/perl/SWMan.pm diff --git a/perl/SWMan.pm b/perl/SWMan.pm index 23f0104..b27fca8 100644 --- a/perl/SWMan.pm +++ b/perl/SWMan.pm @@ -1,6 +1,6 @@ # -*-perl-*- # -# $Id: SWMan.pm,v 1.1 1999/07/30 18:46:37 mdw Exp $ +# $Id: SWMan.pm,v 1.2 1999/08/18 17:10:07 mdw Exp $ # # Display and other fiddling of manual pages # @@ -28,6 +28,9 @@ #----- 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. # @@ -288,18 +291,18 @@ sub man { # --- And email and hypertext references too --- $l =~ s! ((?:\<[bi]\>)*) # Leading highlighting - ((?:http|ftp) # A protocol name - :// # The important and obvious bit + ((?:https?|ftp|file|news) # A protocol name + : # The important and obvious bit [^]&)\s]+ # Most characters are allowed [^]&).,\s\'\"]) # Don't end on punctuation ((?:\)*) # Closing tags, optional - !$&!gx; + !$1$&$3!gx; - $l =~ s! ((?:\<[bi]\>)*) - ( [^\s()&;{}<>,.\`\"] [^\s()&;{}<>\`\"]* \@ - [^\s()&;{}<>\'\"]* [^\s()&;{}<>.,\'\"]) + $l =~ s! ((?:\<[bi]\>)*(?:\bmailto:)?) + ( [^\s()&;:{}<>,.\`\"] [^\s()&;:{}<>\`\"]* \@ + [^\s()&;:{}<>\'\"]* [^\s()&;:{}<>.,\'\"]) ((?:\)*) - !$&!gx; + !$1$&$3!gx; # --- Done! ---