[Po4a-commits] "po4a/lib/Locale/Po4a Man.pm,1.181,1.182"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Sun Aug 20 08:58:39 UTC 2006
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv1904/lib/Locale/Po4a
Modified Files:
Man.pm
Log Message:
Do not change '' to to \*(rq (or `` to \*(lq) if one of the quotes is used
in a string variable (e.g. \*' or \*('' which are generated by Pod::Man).
Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -d -r1.181 -r1.182
--- Man.pm 20 Aug 2006 08:41:47 -0000 1.181
+++ Man.pm 20 Aug 2006 08:58:37 -0000 1.182
@@ -991,8 +991,29 @@
# $str =~ s/^\\f([BI])(.*?)\\f[RP]$/\.$1 $2/mg;
unless ($mdoc_mode) {
- $str =~ s/``/\\\*\(lq/sg;
- $str =~ s/''/\\\*\(rq/sg;
+ my $tmp = "";
+ while ($str =~ m/^(.*?)(``|'')(.*)$/s) {
+ $tmp .= $1;
+ my $q = $2;
+ $str = $3;
+ # There are probably many more exceptions, here are those I could
+ # detect in my manpages.
+ # \*(.' \*(.`
+ # \*' \*`
+ if ($tmp =~ m/(?<!\\)(?:\\\\)*\\\*\($/s) {
+ $tmp .= $q;
+ } elsif ( $tmp =~ m/(?<!\\)(?:\\\\)*\\\*\(.$/s
+ or $tmp =~ m/(?<!\\)(?:\\\\)*\\\*$/s) {
+ $q =~ m/(.)(.)/;
+ $tmp .= $1;
+ $str = $2.$str;
+ } else {
+ $q =~ s/``/\\\*\(lq/;
+ $q =~ s/''/\\\*\(rq/;
+ $tmp .= $q;
+ }
+ }
+ $str = $tmp.$str;
}
print STDERR "$str\n" if ($debug{'postrans'});
More information about the Po4a-commits
mailing list