[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/HTML.pm (converter_initializ
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/HTML.pm (converter_initialize) (conversion_initialization): set FORMAT_MENU, MAX_HEADER_LEVEL, CONTENTS_OUTPUT_LOCATION, INDEX_ENTRY_COLON, MENU_ENTRY_COLON if undef in converter_initialize. Set OPEN_QUOTE_SYMBOL, CLOSE_QUOTE_SYMBOL and MENU_SYMBOL if undef after setting the default. |
Date: |
Thu, 02 May 2024 13:38:40 -0400 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new f933fffc72 * tp/Texinfo/Convert/HTML.pm (converter_initialize)
(conversion_initialization): set FORMAT_MENU, MAX_HEADER_LEVEL,
CONTENTS_OUTPUT_LOCATION, INDEX_ENTRY_COLON, MENU_ENTRY_COLON if undef in
converter_initialize. Set OPEN_QUOTE_SYMBOL, CLOSE_QUOTE_SYMBOL and
MENU_SYMBOL if undef after setting the default.
f933fffc72 is described below
commit f933fffc72f217e6edce12aacb54bd77789ba8f7
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu May 2 19:38:14 2024 +0200
* tp/Texinfo/Convert/HTML.pm (converter_initialize)
(conversion_initialization): set FORMAT_MENU, MAX_HEADER_LEVEL,
CONTENTS_OUTPUT_LOCATION, INDEX_ENTRY_COLON, MENU_ENTRY_COLON if
undef in converter_initialize. Set OPEN_QUOTE_SYMBOL,
CLOSE_QUOTE_SYMBOL and MENU_SYMBOL if undef after setting the default.
* tp/Texinfo/Convert/HTML.pm, tp/Texinfo/XS/convert/convert_html.c:
allow documentlanguage, OUTPUT_ENCODING_NAME,
NO_NUMBER_FOOTNOTE_SYMBOL, xrefautomaticsectiontitle, DEFAULT_RULE,
deftypefnnewline, DOCTYPE, BODY_ELEMENT_ATTRIBUTES, AFTER_BODY_OPEN,
PACKAGE_AND_VERSION, PACKAGE_URL, LINKS_BUTTONS, SECTION_BUTTONS in
About body, JS_WEBLABELS_FILE, HANDLER_FATAL_ERROR_LEVEL to be undef.
* tp/Texinfo/Convert/Info.pm (format_node): handle undef TOP_NODE_UP.
* tp/Texinfo/Convert/HTML.pm (_default_format_special_body_about),
tp/Texinfo/XS/convert/convert_html.c
(default_format_special_body_about): different output for the About
page if the SECTION_BUTTONS are undefined.
* tp/Texinfo/XS/structuring_transfo/structuring.c
(set_menus_node_directions), tp/Texinfo/XS/parsetexi/Parsetexi.pm
(parser), tp/Texinfo/Convert/Plaintext.pm (_convert): handle undef
FORMAT_MENU.
* tp/Makefile.tres, tp/t/test_utils.pl (test), tp/t/10menu.t
(format_menu_undef): add a test with FORMAT_MENU undef.
---
ChangeLog | 30 +++
tp/Makefile.tres | 2 +-
tp/Texinfo/Convert/HTML.pm | 145 ++++++++---
tp/Texinfo/Convert/Info.pm | 5 +-
tp/Texinfo/Convert/Plaintext.pm | 3 +-
tp/Texinfo/XS/convert/convert_html.c | 85 ++++--
tp/Texinfo/XS/parsetexi/Parsetexi.pm | 2 +-
tp/Texinfo/XS/structuring_transfo/structuring.c | 1 +
tp/Texinfo/options_data.txt | 2 +
tp/t/10menu.t | 9 +-
tp/t/results/menu/format_menu_undef.pl | 329 ++++++++++++++++++++++++
tp/t/test_utils.pl | 4 +-
12 files changed, 553 insertions(+), 64 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dffea242a9..6664f82a53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2024-05-02 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/HTML.pm (converter_initialize)
+ (conversion_initialization): set FORMAT_MENU, MAX_HEADER_LEVEL,
+ CONTENTS_OUTPUT_LOCATION, INDEX_ENTRY_COLON, MENU_ENTRY_COLON if
+ undef in converter_initialize. Set OPEN_QUOTE_SYMBOL,
+ CLOSE_QUOTE_SYMBOL and MENU_SYMBOL if undef after setting the default.
+
+ * tp/Texinfo/Convert/HTML.pm, tp/Texinfo/XS/convert/convert_html.c:
+ allow documentlanguage, OUTPUT_ENCODING_NAME,
+ NO_NUMBER_FOOTNOTE_SYMBOL, xrefautomaticsectiontitle, DEFAULT_RULE,
+ deftypefnnewline, DOCTYPE, BODY_ELEMENT_ATTRIBUTES, AFTER_BODY_OPEN,
+ PACKAGE_AND_VERSION, PACKAGE_URL, LINKS_BUTTONS, SECTION_BUTTONS in
+ About body, JS_WEBLABELS_FILE, HANDLER_FATAL_ERROR_LEVEL to be undef.
+
+ * tp/Texinfo/Convert/Info.pm (format_node): handle undef TOP_NODE_UP.
+
+ * tp/Texinfo/Convert/HTML.pm (_default_format_special_body_about),
+ tp/Texinfo/XS/convert/convert_html.c
+ (default_format_special_body_about): different output for the About
+ page if the SECTION_BUTTONS are undefined.
+
+ * tp/Texinfo/XS/structuring_transfo/structuring.c
+ (set_menus_node_directions), tp/Texinfo/XS/parsetexi/Parsetexi.pm
+ (parser), tp/Texinfo/Convert/Plaintext.pm (_convert): handle undef
+ FORMAT_MENU.
+
+ * tp/Makefile.tres, tp/t/test_utils.pl (test), tp/t/10menu.t
+ (format_menu_undef): add a test with FORMAT_MENU undef.
+
2024-05-01 Patrice Dumas <pertusus@free.fr>
* doc/texi2any_api.texi (Simple Navigation Panel Customization):
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 1cbb04ae16..54703d05d0 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -1183,7 +1183,6 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/languages/multiple_lang_chapters_texi2html.pl \
t/results/languages/multiple_lang_chapters_texi2html/res_html \
t/results/languages/multiple_lang_chapters_texi2html/res_info \
- t/results/languages/no_documentlanguage_before_copying.pl \
t/results/languages/simple_documentlanguage.pl \
t/results/languages/unknown_language.pl \
t/results/languages/unknown_region.pl \
@@ -1492,6 +1491,7 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/menu/entry_after_detailmenu.pl \
t/results/menu/example_in_menu_comment.pl \
t/results/menu/example_in_menu_description.pl \
+ t/results/menu/format_menu_undef.pl \
t/results/menu/formats_in_menu.pl \
t/results/menu/inlineraw_in_menu_description.pl \
t/results/menu/invalid_info_menu_entry.pl \
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index acda940e3b..1c82f38c03 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -2812,10 +2812,14 @@ sub _translate_names($)
{
my $self = shift;
- print STDERR "\nTRANSLATE_NAMES encoding_name: "
- .$self->get_conf('OUTPUT_ENCODING_NAME')
- ." documentlanguage: ".$self->get_conf('documentlanguage')."\n"
- if ($self->get_conf('DEBUG'));
+ if ($self->get_conf('DEBUG')) {
+ my $output_encoding_name = $self->get_conf('OUTPUT_ENCODING_NAME');
+ $output_encoding_name = 'UNDEF' if (!defined($output_encoding_name));
+ my $documentlanguage = $self->get_conf('documentlanguage');
+ $documentlanguage = 'UNDEF' if (!defined($documentlanguage));
+ print STDERR "\nTRANSLATE_NAMES encoding_name: $output_encoding_name"
+ ." documentlanguage: $documentlanguage\n";
+ }
# reset strings such that they are translated when needed.
# could also use the keys of $self->{'translated_direction_strings'}
@@ -3692,6 +3696,7 @@ sub _convert_footnote_command($$$$)
$footnote_mark = $number_in_doc;
} else {
$footnote_mark = $self->get_conf('NO_NUMBER_FOOTNOTE_SYMBOL');
+ $footnote_mark = '' if (!defined($footnote_mark));
}
return "($footnote_mark)" if (in_string($self));
@@ -4243,7 +4248,9 @@ sub _default_panel_button_dynamic_direction($$;$$$)
undef, undef, $source_command);
my $node;
- if ($self->get_conf('xrefautomaticsectiontitle') eq 'on') {
+ my $xrefautomaticsectiontitle = $self->get_conf('xrefautomaticsectiontitle');
+ if (defined($xrefautomaticsectiontitle)
+ and $xrefautomaticsectiontitle eq 'on') {
$node = $self->from_element_direction($direction, 'section');
}
@@ -4629,7 +4636,8 @@ sub _default_format_navigation_header($$$$)
<td>
';
} elsif ($self->get_conf('SPLIT')
- and $self->get_conf('SPLIT') eq 'node' and $result ne '') {
+ and $self->get_conf('SPLIT') eq 'node' and $result ne ''
+ and defined($self->get_conf('DEFAULT_RULE'))) {
$result .= $self->get_conf('DEFAULT_RULE')."\n";
}
return $result;
@@ -6390,6 +6398,9 @@ sub _convert_printindex_command($$$$)
$self->_new_document_context($cmdname);
+ my $rule = $self->get_conf('DEFAULT_RULE');
+ $rule = '' if (!defined($rule));
+
my %formatted_letters;
# Next do the entries to determine the letters that are not empty
my @letter_entries;
@@ -6779,7 +6790,7 @@ sub _convert_printindex_command($$$$)
$result_index_entries .= '<tr>' .
"<th id=\"$letter_id{$letter}\">".$formatted_letter
. "</th></tr>\n" . $entries_text
- . "<tr><td
colspan=\"3\">".$self->get_conf('DEFAULT_RULE')."</td></tr>\n";
+ . "<tr><td colspan=\"3\">${rule}</td></tr>\n";
push @letter_entries, $letter_entry;
}
}
@@ -6848,8 +6859,7 @@ sub _convert_printindex_command($$$$)
# TRANSLATORS: section of index entry column header in index formatting
. $self->convert_tree($self->cdt('Section'), 'Tr th idx entries 2')
."</th></tr>\n"
- . "<tr><td colspan=\"3\">".$self->get_conf('DEFAULT_RULE')
- ."</td></tr>\n";
+ . "<tr><td colspan=\"3\">${rule}</td></tr>\n";
$result .= $result_index_entries;
$result .= "</table>\n";
@@ -7781,9 +7791,10 @@ sub _convert_def_line_type($$$$)
$def_call .= $self->html_attribute_class('code', ['def-type']).'>'.
$type_text .'</code>';
}
- if ($self->get_conf('deftypefnnewline') eq 'on'
- and ($base_command_name eq 'deftypefn'
- or $base_command_name eq 'deftypeop')) {
+ if (($base_command_name eq 'deftypefn'
+ or $base_command_name eq 'deftypeop')
+ and $self->get_conf('deftypefnnewline')
+ and $self->get_conf('deftypefnnewline') eq 'on') {
$def_call .= $self->get_info('line_break_element') . ' ';
} elsif ($type_text ne '') {
$def_call .= ' ';
@@ -7849,6 +7860,7 @@ sub _convert_def_line_type($$$$)
'class' => $class_element};
if ($base_command_name eq 'deftypeop'
and $type_element
+ and $self->get_conf('deftypefnnewline')
and $self->get_conf('deftypefnnewline') eq 'on') {
$category_tree = $self->cdt('{category} on @code{{class}}:@* ',
$substrings);
@@ -7866,6 +7878,7 @@ sub _convert_def_line_type($$$$)
if ($type_element
and ($base_command_name eq 'deftypefn'
or $base_command_name eq 'deftypeop')
+ and $self->get_conf('deftypefnnewline')
and $self->get_conf('deftypefnnewline') eq 'on') {
# TODO if in @def* in @example and with @deftypefnnewline
# on there is no effect of @deftypefnnewline on, as @* in
@@ -8099,7 +8112,11 @@ sub _contents_shortcontents_in_title($)
if ($self->get_conf($cmdname)) {
my $contents_text = $self->_contents_inline_element($cmdname, undef);
if ($contents_text ne '') {
- $result .= $contents_text . $self->get_conf('DEFAULT_RULE')."\n";
+ $result .= $contents_text;
+ my $rule = $self->get_conf('DEFAULT_RULE');
+ if (defined($rule)) {
+ $result .= $rule ."\n";
+ }
}
}
}
@@ -8139,8 +8156,13 @@ sub _default_format_titlepage($)
}
}
my $result = '';
- $result .= $titlepage_text.$self->get_conf('DEFAULT_RULE')."\n"
- if (defined($titlepage_text));
+ if (defined($titlepage_text)) {
+ $result .= $titlepage_text;
+ my $rule = $self->get_conf('DEFAULT_RULE');
+ if (defined($rule)) {
+ $result .= $rule."\n";
+ }
+ }
$result .= $self->_contents_shortcontents_in_title();
return $result;
}
@@ -8881,6 +8903,10 @@ sub converter_initialize($)
= $customized_upper_case_commands->{$command};
}
+ # used just below. Set if undef
+ if (!defined($self->get_conf('FORMAT_MENU'))) {
+ $self->force_conf('FORMAT_MENU', '');
+ }
$self->{'commands_conversion'} = {};
my $customized_commands_conversion
@@ -9066,6 +9092,24 @@ sub converter_initialize($)
$self->force_conf('SPLIT', 'node');
}
+ my $max_header_level = $self->get_conf('MAX_HEADER_LEVEL');
+ if (!defined($max_header_level)) {
+ $self->force_conf('MAX_HEADER_LEVEL', $defaults{'MAX_HEADER_LEVEL'});
+ } elsif ($max_header_level < 1) {
+ $self->force_conf('MAX_HEADER_LEVEL', 1);
+ }
+
+ # For CONTENTS_OUTPUT_LOCATION
+ # should lead to contents not output, but if not, it is not an issue,
+ # the way to set contents to be output or not should be through the
+ # contents and shortcontents @-commands and customization options.
+ foreach my $conf ('CONTENTS_OUTPUT_LOCATION', 'INDEX_ENTRY_COLON',
+ 'MENU_ENTRY_COLON') {
+ if (!defined($self->get_conf($conf))) {
+ $self->force_conf($conf, '');
+ }
+ }
+
# XS parser initialization
if ($self->{'converter_descriptor'} and $XS_convert) {
# reformat special_unit_info information passed to XS to simplify
@@ -10217,7 +10261,7 @@ sub _prepare_special_units($$)
next;
}
} else {
- # should not happen
+ # only happens with an unknown CONTENTS_OUTPUT_LOCATION
next;
}
my $special_unit =
$self->_register_special_unit($special_unit_variety);
@@ -10640,7 +10684,7 @@ sub _external_node_href($$$)
my ($target_filebase, $target)
= $self->_normalized_label_id_file($normalized, $node_contents);
- # undef if conversion is called through convert()
+ # always undef if conversion is called through convert()
my $default_target_split = $self->get_conf('EXTERNAL_CROSSREF_SPLIT');
my $external_file_extension = '';
@@ -11153,8 +11197,10 @@ sub _file_header_information($$;$)
$filename);
my $doctype = $self->get_conf('DOCTYPE');
+ $doctype = '' if (!defined($doctype));
my $root_html_element_attributes =
$self->_root_html_element_attributes_string();
my $body_attributes = $self->get_conf('BODY_ELEMENT_ATTRIBUTES');
+ $body_attributes = '' if (!defined($body_attributes));
if ($self->get_conf('HTML_MATH') and $self->get_conf('HTML_MATH') eq
'mathjax'
and $self->get_file_information('mathjax', $filename)) {
$body_attributes .= ' class="tex2jax_ignore"';
@@ -11162,11 +11208,12 @@ sub _file_header_information($$;$)
my $copying_comment = $self->get_info('copying_comment');
$copying_comment = ''
if (not defined($copying_comment));
- my $after_body_open = '';
- $after_body_open = $self->get_conf('AFTER_BODY_OPEN')
- if (defined($self->get_conf('AFTER_BODY_OPEN')));
+ my $after_body_open = $self->get_conf('AFTER_BODY_OPEN');
+ $after_body_open = '' if (!defined($after_body_open));
my $program_and_version = $self->get_conf('PACKAGE_AND_VERSION');
+ $program_and_version = '' if (!defined($program_and_version));
my $program_homepage = $self->get_conf('PACKAGE_URL');
+ $program_homepage = '' if (!defined($program_homepage));
my $program = $self->get_conf('PROGRAM');
my $generator = '';
if (defined($program) and $program ne '') {
@@ -11240,6 +11287,7 @@ sub _get_links($$$$)
my $links = '';
if ($self->get_conf('USE_LINKS')) {
my $link_buttons = $self->get_conf('LINKS_BUTTONS');
+ return $links if (!defined($link_buttons));
foreach my $link (@$link_buttons) {
my $link_href = $self->from_element_direction($link, 'href',
$output_unit,
$filename, $node_command);
@@ -11402,6 +11450,7 @@ sub _default_format_footnotes_sequence($)
$footnote_mark = $number_in_doc;
} else {
$footnote_mark = $self->get_conf('NO_NUMBER_FOOTNOTE_SYMBOL');
+ $footnote_mark = '' if (!defined($footnote_mark));
}
$result .= $self->html_attribute_class('h5', ['footnote-body-heading']) .
'>'.
@@ -11452,7 +11501,18 @@ sub _default_format_special_body_about($$$)
$about .= &{$self->formatting_function('format_program_string')}($self);
$about .= "\n</p>\n";
}
+
$about .= "<p>\n";
+
+ my $buttons = $self->get_conf('SECTION_BUTTONS');
+
+ if (!$buttons) {
+ $about .= $self->convert_tree(
+ $self->cdt('There are no buttons for this document.')). "\n";
+ $about .= "</p>\n";
+ return $about;
+ }
+
$about .= $self->convert_tree(
$self->cdt(' The buttons in the navigation panels have the following
meaning:'),
'ABOUT')
@@ -11480,7 +11540,7 @@ EOT
$active_icons = $self->get_conf('ACTIVE_ICONS');
}
- foreach my $button_spec (@{$self->get_conf('SECTION_BUTTONS')}) {
+ foreach my $button_spec (@{$buttons}) {
next if ($button_spec eq ' ' or ref($button_spec) eq 'CODE'
or ref($button_spec) eq 'SCALAR'
or (ref($button_spec) eq 'ARRAY' and scalar(@$button_spec) != 2));
@@ -11647,9 +11707,11 @@ sub _do_jslicenses_file {
# 'generate' - create file at JS_WEBLABELS_FILE
# 'reference' - reference file at JS_WEBLABELS_FILE but do not create it
# 'omit' - do nothing
- return if (!$setting or $setting ne 'generate');
+ return if (!$setting or $setting ne 'generate' or !defined($path)
+ or $path eq '');
my $doctype = $self->get_conf('DOCTYPE');
+ $doctype = '' if (!defined($doctype));
my $root_html_element_attributes =
$self->_root_html_element_attributes_string();
my $a = $doctype . "\n" ."<html${root_html_element_attributes}>"
.'<head><title>jslicense labels</title></head>
@@ -11841,14 +11903,22 @@ sub conversion_initialization($;$)
$self->{'paragraph_symbol'} = $special_characters_set{'paragraph_symbol'};
if (not defined($self->get_conf('OPEN_QUOTE_SYMBOL'))) {
- $self->set_conf('OPEN_QUOTE_SYMBOL',
$special_characters_set{'left_quote'});
+ my $set = $self->set_conf('OPEN_QUOTE_SYMBOL',
+ $special_characters_set{'left_quote'});
+ # override undef set in init file/command line
+ $self->force_conf('OPEN_QUOTE_SYMBOL', '') if (!$set);
}
if (not defined($self->get_conf('CLOSE_QUOTE_SYMBOL'))) {
- $self->set_conf('CLOSE_QUOTE_SYMBOL',
- $special_characters_set{'right_quote'});
+ my $set = $self->set_conf('CLOSE_QUOTE_SYMBOL',
+ $special_characters_set{'right_quote'});
+ # override undef set in init file/command line
+ $self->force_conf('CLOSE_QUOTE_SYMBOL', '') if (!$set);
}
if (not defined($self->get_conf('MENU_SYMBOL'))) {
- $self->set_conf('MENU_SYMBOL', $special_characters_set{'bullet'});
+ my $set = $self->set_conf('MENU_SYMBOL',
+ $special_characters_set{'bullet'});
+ # override undef set in init file/command line
+ $self->force_conf('MENU_SYMBOL', '') if (!$set);
}
if ($self->get_conf('USE_NUMERIC_ENTITY')) {
@@ -12892,6 +12962,10 @@ sub output($$)
}
my $handler_fatal_error_level = $self->get_conf('HANDLER_FATAL_ERROR_LEVEL');
+ if (!defined($handler_fatal_error_level)) {
+ $handler_fatal_error_level
+ =
$Texinfo::Options::converter_customization_options{'HANDLER_FATAL_ERROR_LEVEL'};
+ }
if ($self->get_conf('HTML_MATH')
and $self->get_conf('HTML_MATH') eq 'mathjax') {
@@ -12954,8 +13028,11 @@ sub output($$)
# set BODY_ELEMENT_ATTRIBUTES
$self->set_global_document_commands('preamble', ['documentlanguage']);
my $structure_preamble_document_language =
$self->get_conf('documentlanguage');
- $self->set_conf('BODY_ELEMENT_ATTRIBUTES',
- 'lang="' . $structure_preamble_document_language . '"');
+ if (defined($structure_preamble_document_language)
+ and $structure_preamble_document_language ne '') {
+ $self->set_conf('BODY_ELEMENT_ATTRIBUTES',
+ 'lang="' . $structure_preamble_document_language . '"');
+ }
$self->set_global_document_commands('before', ['documentlanguage']);
# the presence of contents elements in the document is used in diverse
@@ -13057,7 +13134,11 @@ sub output($$)
my $preamble_document_language = $self->get_conf('documentlanguage');
- if ($default_document_language ne $preamble_document_language) {
+ if (not (!defined($default_document_language)
+ and !defined($preamble_document_language))
+ and (!defined($default_document_language)
+ or !defined($preamble_document_language)
+ or $default_document_language ne $preamble_document_language)) {
$self->_translate_names();
}
@@ -13083,7 +13164,11 @@ sub output($$)
$self->set_global_document_commands('before', ['documentlanguage']);
- if ($default_document_language ne $preamble_document_language) {
+ if (not (!defined($default_document_language)
+ and !defined($preamble_document_language))
+ and (!defined($default_document_language)
+ or !defined($preamble_document_language)
+ or $default_document_language ne $preamble_document_language)) {
$self->_translate_names();
}
diff --git a/tp/Texinfo/Convert/Info.pm b/tp/Texinfo/Convert/Info.pm
index 43a24100f5..dc83a137f9 100644
--- a/tp/Texinfo/Convert/Info.pm
+++ b/tp/Texinfo/Convert/Info.pm
@@ -580,7 +580,10 @@ sub format_node($$)
} elsif ($direction eq 'Up'
and $node->{'extra'}->{'normalized'} eq 'Top') {
# add an up direction for Top node
- $self->_stream_output(", $direction: ".$self->get_conf('TOP_NODE_UP'));
+ my $top_node_up = $self->get_conf('TOP_NODE_UP');
+ if (defined($top_node_up)) {
+ $self->_stream_output(", $direction: ".$top_node_up);
+ }
}
}
$self->_stream_output("\n\n");
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index fc881fd2d9..a970eda277 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -3065,8 +3065,9 @@ sub _convert($$)
# remark:
# cartouche group and raggedright -> nothing on format stack
+ my $format_menu = $self->get_conf('FORMAT_MENU');
if ($menu_commands{$command}
- and $self->get_conf('FORMAT_MENU') eq 'nomenu') {
+ and (!$format_menu or $format_menu eq 'nomenu')) {
return '';
}
if ($self->{'preformatted_context_commands'}->{$command}
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 90d5f76854..d35877e47e 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -13,6 +13,12 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* NOTE the following customization variables should have a
+ value set (ie not undef in Perl, which would translate to NULL in C):
+ FORMAT_MENU MAX_HEADER_LEVEL CONTENTS_OUTPUT_LOCATION OPEN_QUOTE_SYMBOL
+ CLOSE_QUOTE_SYMBOL MENU_SYMBOL INDEX_ENTRY_COLON MENU_ENTRY_COLON
+ */
+
#include <config.h>
#include <string.h>
@@ -650,10 +656,7 @@ html_cdt_string (const char *string, CONVERTER *self,
{
char *translated_string;
char *result;
- const char *lang = 0;
-
- if (self->conf->documentlanguage.string)
- lang = self->conf->documentlanguage.string;
+ const char *lang = self->conf->documentlanguage.string;
translated_string = html_translate_string (self, string, lang,
translation_context);
@@ -3059,7 +3062,7 @@ external_node_href (CONVERTER *self, const ELEMENT
*external_node,
TARGET_FILENAME *target_filename =
normalized_label_id_file (self, normalized, node_contents);
- /* undef if conversion is called through convert() */
+ /* always undef if conversion is called through convert() */
if (self->conf->EXTERNAL_CROSSREF_SPLIT.string
&& strlen (self->conf->EXTERNAL_CROSSREF_SPLIT.string))
/* initialize to EXTERNAL_CROSSREF_SPLIT */
@@ -5942,7 +5945,7 @@ direction_href_attributes (CONVERTER *self, int
direction, TEXT *result)
text_printf (result, " accesskey=\"%s\"", accesskey);
}
- if (self->conf->USE_REL_REV.integer)
+ if (self->conf->USE_REL_REV.integer > 0)
{
const char *button_rel
= direction_string (self, direction, TDS_type_rel,
@@ -6417,9 +6420,11 @@ html_default_format_footnotes_sequence (CONVERTER *self,
TEXT *result)
if (self->conf->NUMBER_FOOTNOTES.integer > 0)
xasprintf (&footnote_mark, "%d", number_in_doc);
- else
+ else if (self->conf->NO_NUMBER_FOOTNOTE_SYMBOL.string)
footnote_mark
= strdup (self->conf->NO_NUMBER_FOOTNOTE_SYMBOL.string);
+ else
+ footnote_mark = strdup ("");
attribute_class = html_attribute_class (self, "h5",
&foot_body_heading_classes);
@@ -6677,10 +6682,9 @@ html_default_format_end_file (CONVERTER *self, const
char *filename,
&& mathjax_jslicenses_file_nr > 0))
{
if (self->conf->JS_WEBLABELS_FILE.string
- && (self->conf->JS_WEBLABELS.string
- && (!strcmp (self->conf->JS_WEBLABELS.string, "generate")
- || !strcmp (self->conf->JS_WEBLABELS.string,
- "reference"))))
+ && self->conf->JS_WEBLABELS.string
+ && (!strcmp (self->conf->JS_WEBLABELS.string, "generate")
+ || !strcmp (self->conf->JS_WEBLABELS.string, "reference")))
{
ELEMENT *tree;
char *js_path = url_protect_url_text (self,
@@ -7016,7 +7020,8 @@ file_header_information (CONVERTER *self, const ELEMENT
*command,
begin_info->root_html_element_attributes = strdup ("");
text_reset (&text);
- text_append (&text, self->conf->BODY_ELEMENT_ATTRIBUTES.string);
+ if (self->conf->BODY_ELEMENT_ATTRIBUTES.string)
+ text_append (&text, self->conf->BODY_ELEMENT_ATTRIBUTES.string);
if (self->conf->HTML_MATH.string
&& !strcmp (self->conf->HTML_MATH.string, "mathjax")
&& html_get_file_information (self, "mathjax", filename, &status) > 0)
@@ -7119,7 +7124,7 @@ get_links (CONVERTER* self, const char *filename,
const OUTPUT_UNIT *output_unit,
const ELEMENT *node_command, TEXT *result)
{
- if (self->conf->USE_LINKS.integer > 0)
+ if (self->conf->USE_LINKS.integer > 0 && self->conf->LINKS_BUTTONS.buttons)
{
int i;
const BUTTON_SPECIFICATION_LIST *link_buttons
@@ -7189,7 +7194,8 @@ html_default_format_begin_file (CONVERTER *self, const
char *filename,
text_init (&result);
- text_append (&result, self->conf->DOCTYPE.string);
+ if (self->conf->DOCTYPE.string)
+ text_append (&result, self->conf->DOCTYPE.string);
text_append_n (&result, "\n", 1);
text_printf (&result, "<html%s>\n",
begin_info->root_html_element_attributes);
text_printf (&result, "<!-- Created by %s, %s -->\n<head>\n",
@@ -7342,7 +7348,8 @@ default_panel_button_dynamic_direction_internal
(CONVERTER *self,
href = from_element_direction (self, direction, HTT_href, 0, 0, element);
- if (!strcmp (self->conf->xrefautomaticsectiontitle.string, "on"))
+ if (self->conf->xrefautomaticsectiontitle.string
+ && !strcmp (self->conf->xrefautomaticsectiontitle.string, "on"))
node = from_element_direction (self, direction, HTT_section, 0, 0, 0);
if (!node)
@@ -7692,17 +7699,17 @@ html_default_format_navigation_panel (CONVERTER *self,
int vertical, TEXT *result)
{
int i;
- /* do the buttons first in case they are formatteed as an empty string */
int nr_of_buttons_shown = 0;
TEXT result_buttons;
char *attribute_class;
- text_init (&result_buttons);
- text_append (&result_buttons, "");
-
if (!buttons)
return;
+ /* do the buttons first in case they are formatted as an empty string */
+ text_init (&result_buttons);
+ text_append (&result_buttons, "");
+
for (i = 0; i < buttons->number; i++)
{
const BUTTON_SPECIFICATION *button = &buttons->list[i];
@@ -7853,6 +7860,7 @@ html_default_format_navigation_header (CONVERTER *self,
text_append (result, "</td>\n<td>\n");
else if (self->conf->SPLIT.string
&& !strcmp (self->conf->SPLIT.string, "node")
+ && self->conf->DEFAULT_RULE.string
&& result->end > result_text_index)
{
text_append (result, self->conf->DEFAULT_RULE.string);
@@ -8271,7 +8279,8 @@ html_default_format_node_redirection_page (CONVERTER
*self,
text_init (&result);
- text_append (&result, self->conf->DOCTYPE.string);
+ if (self->conf->DOCTYPE.string)
+ text_append (&result, self->conf->DOCTYPE.string);
text_append_n (&result, "\n", 1);
text_printf (&result, "<html%s>\n",
begin_info->root_html_element_attributes);
text_printf (&result, "<!-- Created by %s, %s -->\n"
@@ -8895,8 +8904,10 @@ convert_footnote_command (CONVERTER *self, const enum
command_id cmd,
if (self->conf->NUMBER_FOOTNOTES.integer > 0)
xasprintf (&footnote_mark, "%d", foot_num);
- else
+ else if (self->conf->NO_NUMBER_FOOTNOTE_SYMBOL.string)
footnote_mark = strdup (self->conf->NO_NUMBER_FOOTNOTE_SYMBOL.string);
+ else
+ footnote_mark = strdup ("");
if (html_in_string (self))
{
@@ -12041,7 +12052,8 @@ convert_xref_commands (CONVERTER *self, const enum
command_id cmd,
if (!name)
{
- if (!strcmp (self->conf->xrefautomaticsectiontitle.string, "on")
+ if (self->conf->xrefautomaticsectiontitle.string
+ && !strcmp (self->conf->xrefautomaticsectiontitle.string, "on")
&& associated_section
/* this condition avoids infinite recursions, indeed in that case
the node will be used and not the section. There should not be
@@ -13341,7 +13353,9 @@ convert_printindex_command (CONVERTER *self, const enum
command_id cmd,
text_append_n (&result_index_entries, "</th></tr>\n", 11);
text_append (&result_index_entries, entries_text.text);
text_append_n (&result_index_entries, "<tr><td colspan=\"3\">", 20);
- text_append (&result_index_entries, self->conf->DEFAULT_RULE.string);
+ if (self->conf->DEFAULT_RULE.string)
+ text_append (&result_index_entries,
+ self->conf->DEFAULT_RULE.string);
text_append_n (&result_index_entries, "</td></tr>\n", 11);
}
else
@@ -13516,7 +13530,8 @@ convert_printindex_command (CONVERTER *self, const enum
command_id cmd,
"Tr th idx entries 2");
text_append_n (result, "</th></tr>\n", 11);
text_append_n (result, "<tr><td colspan=\"3\">", 20);
- text_append (result, self->conf->DEFAULT_RULE.string);
+ if (self->conf->DEFAULT_RULE.string)
+ text_append (result, self->conf->DEFAULT_RULE.string);
text_append_n (result, "</td></tr>\n", 11);
text_append (result, result_index_entries.text);
text_append_n (result, "</table>\n", 9);
@@ -14838,6 +14853,7 @@ convert_def_line_type (CONVERTER *self, const enum
element_type type,
text_append_n (&def_call, "</code>", 7);
}
if ((base_cmd == CM_deftypefn || base_cmd == CM_deftypeop)
+ && self->conf->deftypefnnewline.string
&& !strcmp (self->conf->deftypefnnewline.string, "on"))
{
text_append_n (&def_call, self->line_break_element.string,
@@ -15004,6 +15020,7 @@ convert_def_line_type (CONVERTER *self, const enum
element_type type,
"class", class_copy);
if (base_cmd == CM_deftypeop && parsed_def->type
+ && self->conf->deftypefnnewline.string
&& !strcmp (self->conf->deftypefnnewline.string, "on"))
{
category_tree
@@ -15027,6 +15044,7 @@ convert_def_line_type (CONVERTER *self, const enum
element_type type,
{
if ((base_cmd == CM_deftypefn || base_cmd == CM_deftypeop)
&& parsed_def->type
+ && self->conf->deftypefnnewline.string
&& !strcmp (self->conf->deftypefnnewline.string, "on"))
{
category_tree
@@ -15359,8 +15377,11 @@ contents_shortcontents_in_title (CONVERTER *self, TEXT
*result)
if (contents_text)
{
text_append (result, contents_text);
- text_append (result, self->conf->DEFAULT_RULE.string);
- text_append_n (result, "\n", 1);
+ if (self->conf->DEFAULT_RULE.string)
+ {
+ text_append (result, self->conf->DEFAULT_RULE.string);
+ text_append_n (result, "\n", 1);
+ }
free (contents_text);
}
}
@@ -15412,7 +15433,7 @@ html_default_format_titlepage (CONVERTER *self)
format_simpletitle (self, &result);
titlepage_text = 1;
}
- if (titlepage_text)
+ if (titlepage_text && self->conf->DEFAULT_RULE.string)
{
text_append (&result, self->conf->DEFAULT_RULE.string);
text_append_n (&result, "\n", 1);
@@ -15539,6 +15560,16 @@ default_format_special_body_about (CONVERTER *self,
}
text_append_n (result, "<p>\n", 4);
+
+ if (!buttons)
+ {
+ translate_convert_to_html_internal (
+ "There are no buttons for this document.", self, 0, 0,
+ result, "ABOUT");
+ text_append_n (result, "</p>\n", 5);
+ return;
+ }
+
translate_convert_to_html_internal (
" The buttons in the navigation panels have the following meaning:",
self, 0, 0, result, "ABOUT");
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index e7eee2c2f3..f531dd20c6 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -147,7 +147,7 @@ sub parser (;$$)
parser_set_documentlanguage_override ($utf8_bytes);
}
} elsif ($key eq 'FORMAT_MENU') {
- if ($conf->{$key} eq 'menu') {
+ if ($conf->{$key} and $conf->{$key} eq 'menu') {
conf_set_show_menu (1);
} else {
conf_set_show_menu (0);
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index c4d4246cb7..07413b37a9 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -815,6 +815,7 @@ set_menus_node_directions (DOCUMENT *document)
return;
if (options && (options->novalidate.integer > 0
+ || !options->FORMAT_MENU.string
|| strcmp (options->FORMAT_MENU.string, "menu")))
check_menu_entries = 0;
diff --git a/tp/Texinfo/options_data.txt b/tp/Texinfo/options_data.txt
index b56368c09f..ce81d67e36 100644
--- a/tp/Texinfo/options_data.txt
+++ b/tp/Texinfo/options_data.txt
@@ -234,6 +234,8 @@ EPUB_CREATE_CONTAINER_FILE converter_customization
undef integer
EPUB_KEEP_CONTAINER_FOLDER converter_customization undef integer
EXTENSION converter_customization undef char
EXTERNAL_CROSSREF_EXTENSION converter_customization undef char
+# This is used like a boolean, but it is set to a char to match SPLIT, such
+# that the value can be set as a copy of SPLIT value
EXTERNAL_CROSSREF_SPLIT converter_customization undef char
EXTERNAL_DIR converter_customization undef char
EXTRA_HEAD converter_customization undef char
diff --git a/tp/t/10menu.t b/tp/t/10menu.t
index 84cc409fa6..a58abcadc2 100644
--- a/tp/t/10menu.t
+++ b/tp/t/10menu.t
@@ -722,7 +722,14 @@ where the max column could be. @w{in w}.
@node app
@appendix GGG
',],
+['format_menu_undef',
+'@node Top
+@top top
+@node chapter
+@chapter Chap
+', {'FORMAT_MENU' => undef}, {'FORMAT_MENU' => undef}
+],
);
my @test_invalid = (
@@ -810,7 +817,7 @@ my %info_tests = (
);
foreach my $test (@test_cases) {
- $test->[3]->{'FORMAT_MENU'} = 'menu' if
(!defined($test->[3]->{'FORMAT_MENU'}));
+ $test->[3]->{'FORMAT_MENU'} = 'menu' if
(!exists($test->[3]->{'FORMAT_MENU'}));
push @{$test->[2]->{'test_formats'}}, 'plaintext';
push @{$test->[2]->{'test_formats'}}, 'html';
push @{$test->[2]->{'test_formats'}}, 'xml';
diff --git a/tp/t/results/menu/format_menu_undef.pl
b/tp/t/results/menu/format_menu_undef.pl
new file mode 100644
index 0000000000..7f97107bfd
--- /dev/null
+++ b/tp/t/results/menu/format_menu_undef.pl
@@ -0,0 +1,329 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'format_menu_undef'} = {
+ 'contents' => [
+ {
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'Top'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 1
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 2
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'chapter'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'chapter'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 4
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Chap'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'section_number' => '1'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 5
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'format_menu_undef'} = '@node Top
+@top top
+
+@node chapter
+@chapter Chap
+';
+
+
+$result_texts{'format_menu_undef'} = 'top
+***
+
+1 Chap
+******
+';
+
+$result_sectioning{'format_menu_undef'} = {
+ 'extra' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'chapter'
+ }
+ },
+ 'section_directions' => {
+ 'up' => {}
+ },
+ 'section_level' => 1,
+ 'section_number' => '1',
+ 'toplevel_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ }
+ }
+ }
+ ],
+ 'section_level' => 0,
+ 'sectioning_root' => {},
+ 'toplevel_directions' => {}
+ }
+ }
+ ],
+ 'section_level' => -1
+ }
+};
+$result_sectioning{'format_menu_undef'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'section_directions'}{'up'}
= $result_sectioning{'format_menu_undef'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'format_menu_undef'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'prev'}
= $result_sectioning{'format_menu_undef'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'format_menu_undef'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'up'}
= $result_sectioning{'format_menu_undef'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'format_menu_undef'}{'extra'}{'section_childs'}[0]{'extra'}{'sectioning_root'}
= $result_sectioning{'format_menu_undef'};
+
+$result_nodes{'format_menu_undef'} = [
+ {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'top',
+ 'extra' => {}
+ },
+ 'node_directions' => {
+ 'next' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'section_number' => '1'
+ }
+ },
+ 'node_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'normalized' => 'chapter'
+ }
+ }
+ },
+ 'normalized' => 'Top'
+ }
+ },
+ {}
+];
+$result_nodes{'format_menu_undef'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'prev'}
= $result_nodes{'format_menu_undef'}[0];
+$result_nodes{'format_menu_undef'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'up'}
= $result_nodes{'format_menu_undef'}[0];
+$result_nodes{'format_menu_undef'}[1] =
$result_nodes{'format_menu_undef'}[0]{'extra'}{'node_directions'}{'next'};
+
+$result_menus{'format_menu_undef'} = [
+ {
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ {
+ 'extra' => {
+ 'normalized' => 'chapter'
+ }
+ }
+];
+
+$result_errors{'format_menu_undef'} = [];
+
+
+$result_floats{'format_menu_undef'} = {};
+
+
+
+$result_converted{'plaintext'}->{'format_menu_undef'} = 'top
+***
+
+1 Chap
+******
+
+';
+
+
+$result_converted{'html'}->{'format_menu_undef'} = '<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>top</title>
+
+<meta name="description" content="top">
+<meta name="keywords" content="top">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a href="#chapter" accesskey="n" rel="next">Chap</a> </p>
+</div>
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top">
¶</a></span></h1>
+
+<hr>
+<div class="chapter-level-extent" id="chapter">
+<div class="nav-panel">
+<p>
+Previous: <a href="#Top" accesskey="p" rel="prev">top</a>, Up: <a href="#Top"
accesskey="u" rel="up">top</a> </p>
+</div>
+<h2 class="chapter" id="Chap"><span>1 Chap<a class="copiable-link"
href="#Chap"> ¶</a></span></h2>
+</div>
+</div>
+
+
+
+</body>
+</html>
+';
+
+
+$result_converted{'xml'}->{'format_menu_undef'} = '<node name="Top" spaces="
"><nodename>Top</nodename><nodenext automatic="on">chapter</nodenext></node>
+<top spaces=" "><sectiontitle>top</sectiontitle>
+
+</top>
+<node name="chapter" spaces=" "><nodename>chapter</nodename><nodeprev
automatic="on">Top</nodeprev><nodeup automatic="on">Top</nodeup></node>
+<chapter spaces=" "><sectiontitle>Chap</sectiontitle>
+</chapter>
+';
+
+1;
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index a1b84fc36a..f1676116f2 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -1062,11 +1062,11 @@ sub test($$)
# customization. This allows to use functions calling get_conf and
# set_conf to manipulate customization information.
# After this is done, the customization information should not
- # change enymore, and it is registered in the document and used by
+ # change anymore, and it is registered in the document and used by
# Structuring/Transformations methods needing access to configuration
# information.
foreach my $parser_and_structuring_option ('FORMAT_MENU', 'DEBUG') {
- if (defined($parser_options->{$parser_and_structuring_option})) {
+ if (exists($parser_options->{$parser_and_structuring_option})) {
$test_customization_options->{$parser_and_structuring_option}
= $parser_options->{$parser_and_structuring_option};
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/HTML.pm (converter_initialize) (conversion_initialization): set FORMAT_MENU, MAX_HEADER_LEVEL, CONTENTS_OUTPUT_LOCATION, INDEX_ENTRY_COLON, MENU_ENTRY_COLON if undef in converter_initialize. Set OPEN_QUOTE_SYMBOL, CLOSE_QUOTE_SYMBOL and MENU_SYMBOL if undef after setting the default.,
Patrice Dumas <=