[Po4a-commits] "po4a/lib/Locale/Po4a Sgml.pm,1.66,1.67"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Tue Sep 13 14:11:41 UTC 2005


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

Modified Files:
	Sgml.pm 
Log Message:
Ignore <![ IGNORE [ sections.


Index: Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- Sgml.pm	13 Sep 2005 12:43:32 -0000	1.66
+++ Sgml.pm	13 Sep 2005 14:11:39 -0000	1.67
@@ -469,7 +469,27 @@
     $origfile =~ s/<!\[(\s*[^\[]+)\[/{PO4A-beg-$1}/g; # cond. incl. starts
     $origfile =~ s/\]\]>/{PO4A-end}/g;                # cond. incl. end
 
+    # Remove <![ IGNORE [ sections
+    # FIXME: we don't support included PO4A-beg-
     my $tmp1 = $origfile;
+    while ($tmp1 =~ m/^(.*?)({PO4A-beg-\s*IGNORE\s*}(?:.+?){PO4A-end})(.*)$/s)
+    {
+        my ($begin,$ignored,$end) = ($1, $2, $3);
+        my @begin   = split(/\n/, $begin);
+        my @ignored = split(/\n/, $ignored);
+        my $pre = scalar @begin;
+        my $len = (scalar @ignored) -1;
+        $pre++ if ($begin =~ /\n$/s);
+        $len++ if ($end   =~ /^\n/s);
+        # remove the references of the ignored lines
+        splice @refs, $pre+1, $len-1;
+        # remove the lines
+        $tmp1 = $begin.$end;
+    }
+    $origfile = $tmp1;
+    # The <, >, and & in a CDATA must be escaped because they do not
+    # correspond to tags or entities delimiters.
+    $tmp1 = $origfile;
     $origfile = "";
     while ($tmp1 =~ m/^(.*?{PO4A-beg-[^}]*})(.+?)({PO4A-end}.*)$/s) {
         my ($begin, $tmp) = ($1, $2);




More information about the Po4a-commits mailing list