[Po4a-commits] "po4a/lib/Locale/Po4a Xml.pm,1.81,1.82"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Fri Jan 30 21:41:52 UTC 2009
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory alioth:/tmp/cvs-serv3019/lib/Locale/Po4a
Modified Files:
Xml.pm
Log Message:
* lib/Locale/Po4a/Xml.pm: accept an additional list of path
element to be added at the end of the path in get_path(). This
avoids having paths starting with "outside any tag (error?)".
Index: Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- Xml.pm 29 Dec 2008 12:28:06 -0000 1.81
+++ Xml.pm 30 Jan 2009 21:41:49 -0000 1.82
@@ -745,7 +745,7 @@
sub tag_break_alone {
my ($self, at tag)=@_;
- my $struct = $self->get_path."<".$self->get_tag_name(@tag).">";
+ my $struct = $self->get_path($self->get_tag_name(@tag));
if ($self->get_translate_options($struct) =~ m/i/) {
return 0;
} else {
@@ -766,7 +766,7 @@
sub tag_break_open {
my ($self, at tag)=@_;
- my $struct = $self->get_path."<".$self->get_tag_name(@tag).">";
+ my $struct = $self->get_path($self->get_tag_name(@tag));
my $options = $self->get_translate_options($struct);
if ($options =~ m/[ip]/) {
return 0;
@@ -802,8 +802,9 @@
sub get_path {
my $self = shift;
- if ( @path > 0 ) {
- return "<".join("><", at path).">";
+ my @add = @_;
+ if ( @path > 0 or @add > 0 ) {
+ return "<".join("><", at path, at add).">";
} else {
return "outside any tag (error?)";
}
@@ -1250,7 +1251,7 @@
if ($tag_types[$type]->{'end'} eq "") {
if ($tag_types[$type]->{'beginning'} eq "") {
# Opening inline tag
- if ($self->get_translate_options($self->get_path."<".$self->get_tag_name(@tag).">") =~ m/p/) {
+ if ($self->get_translate_options($self->get_path($self->get_tag_name(@tag))) =~ m/p/) {
# We enter a new holder.
# Append a <placeholder#> tag to the current
# paragraph, and save the @paragraph in the
@@ -1301,7 +1302,7 @@
}
}
- if ($self->get_translate_options($self->get_path."<".$self->get_tag_name(@tag).">") =~ m/p/) {
+ if ($self->get_translate_options($self->get_path($self->get_tag_name(@tag))) =~ m/p/) {
# This closes the current holder.
push @path, $self->get_tag_name(@tag);
More information about the Po4a-commits
mailing list