[Po4a-devel][CVS] po4a/lib/Locale/Po4a Sgml.pm,1.27,1.28

Martin Quinson po4a-devel@lists.alioth.debian.org
Sun, 01 Aug 2004 20:56:18 +0000


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

Modified Files:
	Sgml.pm 
Log Message:
allow entities definition to contain '>'. Fixes Debian's #262735

Index: Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- Sgml.pm	1 Aug 2004 20:33:13 -0000	1.27
+++ Sgml.pm	1 Aug 2004 20:56:16 -0000	1.28
@@ -178,7 +178,7 @@
 
 my %debug=('tag' => 0, 
 	   'generic' => 0,
-	   'entities' => 0,
+	   'entities' => 1,
            'refs'   => 0);
 
 my $xmlprolog = undef; # the '<?xml ... ?>' line if existing
@@ -536,10 +536,11 @@
     #  <!ENTITY myentity "definition_of_my_entity">
     # and push("<!ENTITY myentity \"".$self->translate("definition_of_my_entity")
     if ($prolog =~ m/(.*?\[)(.*)(\]>)/s) {
+	warn "Pre=~~$1~~;Post=~~$3~~\n" if ($debug{'entities'});
         $self->pushline($1);
         $prolog=$2;					       
         my ($post) = $3;			
-        while ($prolog =~ m/^(.*?)<!ENTITY\s(\S*)\s*"([^>"]*)">(.*)$/is) { #" ){ 
+        while ($prolog =~ m/^(.*?)<!ENTITY\s+(\S*)\s+"([^"]*)">(.*)$/is) { #" ){ 
 	   $self->pushline($1);
 	   $self->pushline("<!ENTITY $2 \"".$self->translate($3,"","definition of entity \&$2;")."\">");
 	   warn "Seen text entity $2" if ($debug{'entities'});
@@ -548,8 +549,8 @@
         $self->pushline($post);
     } else {
 	warn "No entity declaration detected in ~~$prolog~~...\n" if ($debug{'entities'});
+	$self->pushline($prolog);
     } 
-    $self->pushline($prolog);
 
     # The parse object.
     # Damn SGMLS. It makes me crude things.