[Po4a-commits] po4a/lib/Locale/Po4a TeX.pm,1.28,1.29
Nicolas FRAN??OIS
po4a-devel@lists.alioth.debian.org
Sat, 19 Feb 2005 22:04:36 +0000
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv21886/lib/Locale/Po4a
Modified Files:
TeX.pm
Log Message:
Fix a longstanding FIXME regarding '%' preceded by an even number of '\'.
Index: TeX.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TeX.pm,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- TeX.pm 19 Feb 2005 21:59:31 -0000 1.28
+++ TeX.pm 19 Feb 2005 22:04:34 -0000 1.29
@@ -888,7 +888,7 @@
if ($closed and $line =~ /^ *$/) {#FIXME: should it be \s*?
# An empty line. This indicates the end of the current
# paragraph.
- $paragraph =~ s/(?<!\\)%$//; # FIXME: even number of \ ...
+ $paragraph =~ s/(?<!\\)(?:\\\\)*%$//;
if (length($paragraph)) {
($t, @env) = translate_buffer($self,$paragraph,@env);
$self->pushline($t);
@@ -897,7 +897,7 @@
$self->pushline($line."\n");
} elsif ($line =~ /^\\begin\{/) {
# break the paragraph at the beginning of a new environment.
- $paragraph =~ s/(?<!\\)%$//; # FIXME: even number of \ ...
+ $paragraph =~ s/(?<!\\)(?:\\\\)*%$//;
$closed = is_closed($paragraph);
if ($closed and length($paragraph)) {
($t, @env) = translate_buffer($self,$paragraph,@env);
@@ -907,7 +907,7 @@
$paragraph .= $line."\n";
} else {
# continue the same paragraph
- if ($paragraph =~ /(?<!\\)%$/) { # FIXME: even number of \ ...
+ if ($paragraph =~ /(?<!\\)(?:\\\\)*%$/) {
$paragraph =~ s/%$//s;
chomp $paragraph;
$line =~ s/^ *//;