[Po4a-commits] "po4a/lib/Locale/Po4a Docbook.pm, 1.10, 1.11 Xml.pm, 1.34, 1.35"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sun Dec 4 16:44:53 UTC 2005


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

Modified Files:
	Docbook.pm Xml.pm 
Log Message:
New "nodefault" option, to avoid a specified tag to be set in the tags or
inline category by defaut.


Index: Docbook.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Docbook.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Docbook.pm	18 Nov 2005 00:34:02 -0000	1.10
+++ Docbook.pm	4 Dec 2005 16:44:51 -0000	1.11
@@ -132,7 +132,7 @@
 		<term>
 		<title>
 		<titleabbrev>) {
-		if ($self->{options}{'inline'} !~ /(^|\s+)\Q$tag\E(?:\s+|$)/) {
+		if (not defined $self->{nodefault}{$tag}) {
 			$additional_tags .= " $tag";
 		}
 	}
@@ -234,7 +234,7 @@
 		<wordasword>
 		<xref>
 		<year>) {
-		if ($self->{options}{'tags'} !~ /(^|\s+)\Q$tag\E(?:\s+|$)/) {
+		if ($self->{options}{'inline'} !~ /(^|\s+)\Q$tag\E(?:\s+|$)/) {
 			$additional_inline .= " $tag";
 		}
 	}

Index: Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- Xml.pm	4 Dec 2005 16:18:43 -0000	1.34
+++ Xml.pm	4 Dec 2005 16:44:51 -0000	1.35
@@ -167,6 +167,11 @@
 Space-separated list of the tags you want to treat as inline.  By default,
 all tags break the sequence.  This follows the same syntax as the tags option.
 
+=item nodefault
+
+Space separated list of tags that the module should not try to set by
+default in the "tags" or "inline" category.
+
 =back
 
 =cut
@@ -183,6 +188,7 @@
 	$self->{options}{'attributes'}='';
 	$self->{options}{'inline'}='';
 	$self->{options}{'doctype'}='';
+	$self->{options}{'nodefault'}='';
 
 	$self->{options}{'verbose'}='';
 	$self->{options}{'debug'}='';
@@ -202,6 +208,9 @@
 	$self->{attributes}=();
 	#It will maintain the list of the inline tags
 	$self->{inline}=();
+	#list of the tags that must not be set in the tags or inline category
+	#by this module or sub-module (unless specified in an option)
+	$self->{nodefault}=();
 
 	$self->treat_options;
 }
@@ -1038,6 +1047,13 @@
 	$self->{options}{'inline'} =~ /\s*(.*)\s*/s;
 	my @list_inline = split(/\s+/s,$1);
 	$self->{inline} = \@list_inline;
+        
+	$self->{options}{'nodefault'} =~ /\s*(.*)\s*/s;
+	my %list_nodefault;
+	foreach (split(/\s+/s,$1)) {
+	    $list_nodefault{$_} = 1;
+	}
+	$self->{nodefault} = \%list_nodefault;
 }
 
 =head2 GETTING TEXT FROM THE INPUT DOCUMENT




More information about the Po4a-commits mailing list