[Po4a-commits] "po4a/lib/Locale/Po4a Man.pm,1.100,1.101"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Fri Sep 2 19:12:43 UTC 2005


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv31002/lib/Locale/Po4a

Modified Files:
	Man.pm 
Log Message:
When a font macro (.B, .I) is followed by another font macro (.B, .I, .BI,
..., but also .SH or .TP, which reset the current font), we can forget the
first font.


Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- Man.pm	2 Sep 2005 16:20:08 -0000	1.100
+++ Man.pm	2 Sep 2005 19:12:41 -0000	1.101
@@ -433,14 +433,27 @@
         my ($l2,$r2)=$self->SUPER::shiftline();
         chomp($l2);
         if ($line =~ /^(\.[BI])\s*$/) {
-            # convert " to the groff's double quote glyph; it will be
-            # converted back to " in pre_trans. It is needed because
-            # otherwise, these quotes will be taken as arguments
-            # delimiters.
-            $l2 =~ s/"/\\(dq/g;
-            # append this line to the macro, with surrounding quotes, so
-            # that the line appear as an uniq argument.
-            $line .= ' "'.$l2.'"';
+            if ($l2 =~ /^[.'][\t ]*([BIR]|BI|BR|IB|IR|RB|RI|SH|TP)[\t ]/) {
+                # another font macro. Forget about the first one
+                $line = $l2;
+                $ref = $r2;
+            } elsif ($l2 =~ /^[.']/) {
+                die wrap_ref_mod($ref, "po4a::man", dgettext("po4a",
+                        "po4a does not support font modifiers followed by a ".
+                        "command.  You should either remove the font modifier ".
+                        "'%s', or integrate a \\f font modifier in the ".
+                        "following command ('%s')"
+                        ), $line, $l2);
+            } else {
+                # convert " to the groff's double quote glyph; it will be
+                # converted back to " in pre_trans. It is needed because
+                # otherwise, these quotes will be taken as arguments
+                # delimiters.
+                $l2 =~ s/"/\\(dq/g;
+                # append this line to the macro, with surrounding quotes, so
+                # that the line appear as an uniq argument.
+                $line .= ' "'.$l2.'"';
+            }
         } else {
             $line =~ s/\\$//;
             $line .= $l2;




More information about the Po4a-commits mailing list