develooper Front page | perl.perl5.porters | Postings from May 2004

[PATCH] correctly handle C<< >> and C<<< >>> in diagnostics

Thread Next
From:
Yitzchak Scott-Thoennes
Date:
May 25, 2004 02:29
Subject:
[PATCH] correctly handle C<< >> and C<<< >>> in diagnostics
Message ID:
20040525092937.GA2332@efn.org
This is just a quick hack; ideally someone would make it use an actual
pod parser.

--- perl/lib/diagnostics.pm.orig	2003-12-30 15:48:47.000000000 -0800
+++ perl/lib/diagnostics.pm	2004-05-25 01:54:31.735904000 -0700
@@ -314,10 +314,10 @@
 	    sub noop   { return $_[0] }  # spensive for a noop
 	    sub bold   { my $str =$_[0];  $str =~ s/(.)/$1\b$1/g; return $str; } 
 	    sub italic { my $str = $_[0]; $str =~ s/(.)/_\b$1/g;  return $str; } 
-	    s/[BC]<(.*?)>/bold($1)/ges;
+	    s/C<<< (.*?) >>>|C<< (.*?) >>|[BC]<(.*?)>/bold($+)/ges;
 	    s/[LIF]<(.*?)>/italic($1)/ges;
 	} else {
-	    s/[BC]<(.*?)>/$1/gs;
+	    s/C<<< (.*?) >>>|C<< (.*?) >>|[BC]<(.*?)>/$+/gs;
 	    s/[LIF]<(.*?)>/$1/gs;
 	} 
 	unless (/^=/) {


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About