[Po4a-commits] po4a/lib/Locale/Po4a Man.pm,1.56,1.57

Nicolas FRAN??OIS po4a-devel@lists.alioth.debian.org
Thu, 11 Nov 2004 22:34:23 +0000


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

Modified Files:
	Man.pm 
Log Message:
More escapes for dots and single quotes at the beginning of a line.


Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- Man.pm	11 Nov 2004 22:22:54 -0000	1.56
+++ Man.pm	11 Nov 2004 22:34:20 -0000	1.57
@@ -421,8 +421,21 @@
         $str =~ s/(?<!\\s)-/\\-/sg; # (?<!pattern) means "not preceded by pattern"
     }
 
-    # No . on first char, or nroff will think it's a macro
-    $str =~ s/\n([.'"])/ $1/mg; #'
+    # 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|HP)$/) {
+        # This doesn't work after a TP, HP or TS (all those macros shift
+        # lines, which may contain macros)
+        $str =~ s/^((?:
+                       (?:CW|[RBI])<
+                      |$FONT_RE
+                    )?
+                    [.']
+                   )/\\&$1/mgx;
+    }
+    # * degraded mode, doesn't work for the first line of a paragraph
+    $str =~ s/\n([.'])/ $1/mg;
 
     # Change ascii non-breaking space to groff one
     $str =~ s|\xA0|\\ |sg;