[Po4a-commits] "po4a/lib/Locale/Po4a Xml.pm,1.45,1.46"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Wed Apr 12 23:46:03 UTC 2006


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

Modified Files:
	Xml.pm 
Log Message:
This disables placeholders by default, and allows users to test this
functionality with the "-o placeholder=foo" option.


Index: Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- Xml.pm	12 Apr 2006 23:13:59 -0000	1.45
+++ Xml.pm	12 Apr 2006 23:46:01 -0000	1.46
@@ -972,7 +972,9 @@
 			if ($tag_types[$type]->{'end'} eq "") {
 				if ($tag_types[$type]->{'beginning'} eq "") {
 					# Opening inline tag
-					if ($self->get_tag_name(@tag) =~ m/(footnote)/) { # FIXME
+					my $placeholder_regex = join("|", @{$self->{placeholder}});
+					if (length($placeholder_regex) and
+					    $self->get_tag_name(@tag) =~ m/($placeholder_regex)/) { # FIXME
 						# We enter a new holder.
 						# Append a <placeholder#> tag to the current
 						# paragraph, and save the @paragraph in the
@@ -1013,7 +1015,9 @@
 						die wrap_ref_mod($tag[1], "po4a::xml", dgettext("po4a", "Unexpected closing tag </%s> found. The main document may be wrong."), $tag[0]);
 					}
 
-					if ($self->get_tag_name(@tag) =~ m/(footnote)/) {
+					my $placeholder_regex = join("|", @{$self->{placeholder}});
+					if (length($placeholder_regex) and
+					    $self->get_tag_name(@tag) =~ m/($placeholder_regex)/) {
 						# This closes the current holder.
 
 						# We keep the closing tag in the holder paragraph.
@@ -1249,6 +1253,10 @@
 	$self->{options}{'inline'} =~ /\s*(.*)\s*/s;
 	my @list_inline = split(/\s+/s,$1);
 	$self->{inline} = \@list_inline;
+
+	$self->{options}{'placeholder'} =~ /\s*(.*)\s*/s;
+	my @list_placeholder = split(/\s+/s,$1);
+	$self->{placeholder} = \@list_placeholder;
         
 	$self->{options}{'nodefault'} =~ /\s*(.*)\s*/s;
 	my %list_nodefault;




More information about the Po4a-commits mailing list