[Po4a-commits] po4a/lib/Locale/Po4a Man.pm,1.61,1.62

Nicolas FRAN??OIS po4a-devel@lists.alioth.debian.org
Fri, 12 Nov 2004 16:36:17 +0000


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

Modified Files:
	Man.pm 
Log Message:
The .TP macro unshift the next line (which should be the tag). Don't do
that if the next line is a macro. In this case, let the parser handle this
line.
This permits to handle lines beginning by a period or an apostrophe after
a '.TP'.


Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- Man.pm	12 Nov 2004 14:07:42 -0000	1.61
+++ Man.pm	12 Nov 2004 16:36:14 -0000	1.62
@@ -424,8 +424,8 @@
     # No . or ' on first char, or nroff will think it's a macro
     # * at the beginning of a paragraph, add \& (zero width space) at
     #   the beginning of the line
-    unless (defined $self->{type} && $self->{type} =~ m/^(TS|TP)$/) {
-        # This doesn't work after a TP or TS (all those macros shift
+    unless (defined $self->{type} && $self->{type} =~ m/^(TS)$/) {
+        # This doesn't work after a TS (this macros shift
         # lines, which may contain macros)
         $str =~ s/^((?:
                        (?:CW|[RBI])<
@@ -1077,7 +1077,17 @@
 	($l2,$ref2) = $self->shiftline();
 	chomp($l2);
     }
-    $self->pushline($self->t($l2)."\n");
+    if ($l2 =~/^[.']/) {
+	# If the line after a .TP is a macro,
+	# let the parser do it's job.
+	# Note: use Transtractor unshiftline for now. This may require an
+	#       implementation of the man module's own implementation.
+	#       This may be a problem if, for example, the line resulted
+	#       of a line continuation.
+	$self->SUPER::unshiftline($l2,$ref2);
+    } else {
+	$self->pushline($self->t($l2)."\n");
+    }
 
     # From info groff:
     # Note that neither font shape nor font size of the label [i.e. argument