[Po4a-commits] "po4a/lib/Locale/Po4a Man.pm,1.106,1.107"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Fri Sep 2 21:07:15 UTC 2005


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

Modified Files:
	Man.pm 
Log Message:
If a .TP is followed by an inline macro, translate the inline macro's
arguments.


Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- Man.pm	2 Sep 2005 20:58:42 -0000	1.106
+++ Man.pm	2 Sep 2005 21:07:13 -0000	1.107
@@ -1507,14 +1507,22 @@
 	($l2,$ref2) = $self->shiftline();
 	chomp($l2);
     }
-    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);
+    if ($l2 =~/^([.'][\t ]*([^\t ]*))(?:[\t ]+(.*)$|$)/) {
+        if ($inline{$2}) {
+            my $tmp = "";
+            if (defined $3 and length $3) {
+                $tmp = $self->t($3, "wrap" => 0);
+            }
+            $self->pushline($1.$tmp."\n");
+        } else {
+            # 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, "wrap" => 0)."\n");
     }




More information about the Po4a-commits mailing list