[Po4a-commits] "po4a/lib/Locale/Po4a Sgml.pm,1.102,1.103"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sun Dec 4 20:28:48 UTC 2005


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

Modified Files:
	Sgml.pm 
Log Message:
In the verbatim mode, we can ignore empty lines, but not the leading
spaces or tabulations. Otherwise, the PO will look weird.

The generated files were OK, but the POs contained things like:
msgid ""
"1  foo\n"
"  2  bar\n
"  3\n"
...


Index: Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- Sgml.pm	28 Nov 2005 22:21:22 -0000	1.102
+++ Sgml.pm	4 Dec 2005 20:28:46 -0000	1.103
@@ -1113,10 +1113,21 @@
     # Extract the leading and trailing spaces. They will be restored only
     # in verbatim environments.
     my ($leading_spaces, $trailing_spaces) = ("", "");
-    if ($para =~ m/^(\s*)(.*?)(\s*)$/s) {
-	$leading_spaces = $1;
-	$para = $2;
-	$trailing_spaces = $3;
+    if ($verb) {
+	# In the verbatim mode, we can ignore empty lines, but not the
+	# leading spaces or tabulations. Otherwise, the PO will look
+	# weird.
+	if ($para =~ m/^(\s*\n)(.*?)(\s*)$/s) {
+	    $leading_spaces = $1;
+	    $para = $2;
+	    $trailing_spaces = $3;
+	}
+    } else {
+	if ($para =~ m/^(\s*)(.*?)(\s*)$/s) {
+	    $leading_spaces = $1;
+	    $para = $2;
+	    $trailing_spaces = $3;
+	}
     }
 
     $para = $self->translate($para,$ref,$type,




More information about the Po4a-commits mailing list