[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_fil
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files): no warning for an empty URL prefix as it is the only way to override an entry appearing in a file processed later on. |
Date: |
Sat, 24 Aug 2024 08:55:59 -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 0eb1566865 * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files): no
warning for an empty URL prefix as it is the only way to override an entry
appearing in a file processed later on.
0eb1566865 is described below
commit 0eb1566865db5d18c2bd6e6935cd137962322d55
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Aug 24 14:55:34 2024 +0200
* tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files): no warning for
an empty URL prefix as it is the only way to override an entry
appearing in a file processed later on.
* tp/t/htmlxref.t (htmlxref_no_urlprefix_first), tp/Makefile.tres,
tp/t/input_files/htmlxref-no_urlprefix_first.cnf, tp/Makefile.am
(test_files): new test with htmlxref entry with an empty URL prefix
before an entry with URL prefix.
---
ChangeLog | 11 +
tp/Makefile.am | 1 +
tp/Makefile.tres | 2 +
tp/Texinfo/Convert/HTML.pm | 12 +-
tp/t/htmlxref.t | 16 +
tp/t/input_files/htmlxref-no_urlprefix_first.cnf | 5 +
tp/t/results/htmlxref/htmlxref.pl | 8 -
.../htmlxref/htmlxref_no_urlprefix_first.pl | 361 +++++++++++++++++++++
.../htmlxref_no_urlprefix_first/res_html/chap.html | 45 +++
.../res_html/index.html | 51 +++
tp/t/results/htmlxref/htmlxref_nodes.pl | 8 -
tp/t/results/htmlxref/htmlxref_only_split.pl | 12 -
tp/t/results/htmlxref/htmlxref_only_split_nodes.pl | 12 -
13 files changed, 499 insertions(+), 45 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 69ed1e7a4d..9a13432f37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-08-24 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files): no warning for
+ an empty URL prefix as it is the only way to override an entry
+ appearing in a file processed later on.
+
+ * tp/t/htmlxref.t (htmlxref_no_urlprefix_first), tp/Makefile.tres,
+ tp/t/input_files/htmlxref-no_urlprefix_first.cnf, tp/Makefile.am
+ (test_files): new test with htmlxref entry with an empty URL prefix
+ before an entry with URL prefix.
+
2024-08-23 Patrice Dumas <pertusus@free.fr>
* INSTALL: correct a typo.
diff --git a/tp/Makefile.am b/tp/Makefile.am
index 9b2d78012f..f68632ac53 100644
--- a/tp/Makefile.am
+++ b/tp/Makefile.am
@@ -289,6 +289,7 @@ test_files = \
t/input_files/transliterated_names_conflicts.texi \
t/input_files/htmlxref.cnf \
t/input_files/htmlxref-mono.cnf \
+ t/input_files/htmlxref-no_urlprefix_first.cnf \
t/input_files/htmlxref-split.cnf \
#
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index fdc8196dd0..7a593b7a4b 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -798,6 +798,8 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/html_tests/xml_protected_in_verb.pl \
t/results/htmlxref/htmlxref.pl \
t/results/htmlxref/htmlxref/res_html \
+ t/results/htmlxref/htmlxref_no_urlprefix_first.pl \
+ t/results/htmlxref/htmlxref_no_urlprefix_first/res_html \
t/results/htmlxref/htmlxref_nodes.pl \
t/results/htmlxref/htmlxref_nodes/res_html \
t/results/htmlxref/htmlxref_only_mono.pl \
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index f9abd8aa40..3a99bd5530 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -8662,11 +8662,13 @@ sub _parse_htmlxref_files($$)
next;
}
my $href = shift @htmlxref;
- if (!defined($href)) {
- $self->converter_line_warn(sprintf(
- __("missing %s URL prefix for `%s'"), $split_or_mono, $manual),
- {'file_name' => $fname, 'line_nr' => $line_nr});
- }
+ # No warning for an empty URL prefix as it is the only way to
+ # override an entry appearing in a file processed later on
+ #if (!defined($href)) {
+ # $self->converter_line_warn(sprintf(
+ # __("missing %s URL prefix for `%s'"), $split_or_mono, $manual),
+ # {'file_name' => $fname, 'line_nr' => $line_nr});
+ #}
next if ($htmlxref->{$manual}
and exists($htmlxref->{$manual}->{$split_or_mono}));
diff --git a/tp/t/htmlxref.t b/tp/t/htmlxref.t
index a456e829de..ae19d817c9 100644
--- a/tp/t/htmlxref.t
+++ b/tp/t/htmlxref.t
@@ -42,6 +42,22 @@ my @test_cases = (
'SPLIT' => 'node',
'USE_NODES' => 1}
],
+['htmlxref_no_urlprefix_first',
+'@node top
+@top top
+
+@node chap
+@chapter Chap
+
+@xref{,,,manual}.
+
+@xref{,,,manual2}.
+
+',
+{'full_document' => 1,
+ 'test_input_file_name' => 'htmlxref_no_urlprefix_first.texi'},
+{'HTMLXREF_FILE' => 'htmlxref-no_urlprefix_first.cnf'}
+],
);
diff --git a/tp/t/input_files/htmlxref-no_urlprefix_first.cnf
b/tp/t/input_files/htmlxref-no_urlprefix_first.cnf
new file mode 100644
index 0000000000..1407a2d69d
--- /dev/null
+++ b/tp/t/input_files/htmlxref-no_urlprefix_first.cnf
@@ -0,0 +1,5 @@
+
+manual section
+manual section somewhere
+
+manual2 section Here
diff --git a/tp/t/results/htmlxref/htmlxref.pl
b/tp/t/results/htmlxref/htmlxref.pl
index cccebbae78..463e68994b 100644
--- a/tp/t/results/htmlxref/htmlxref.pl
+++ b/tp/t/results/htmlxref/htmlxref.pl
@@ -2915,14 +2915,6 @@ $result_floats{'htmlxref'} = {};
$result_converted_errors{'file_html'}->{'htmlxref'} = [
- {
- 'error_line' => 'warning: missing section URL prefix for `manual\'
-',
- 'file_name' => 'htmlxref.cnf',
- 'line_nr' => 12,
- 'text' => 'missing section URL prefix for `manual\'',
- 'type' => 'warning'
- },
{
'error_line' => 'warning: unrecognized type: foo
',
diff --git a/tp/t/results/htmlxref/htmlxref_no_urlprefix_first.pl
b/tp/t/results/htmlxref/htmlxref_no_urlprefix_first.pl
new file mode 100644
index 0000000000..6c6cd1fa9f
--- /dev/null
+++ b/tp/t/results/htmlxref/htmlxref_no_urlprefix_first.pl
@@ -0,0 +1,361 @@
+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{'htmlxref_no_urlprefix_first'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'type' => 'preamble_before_content'
+ }
+ ],
+ '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' => 'chap'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'chap'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 4
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Chap'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'manual'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'xref',
+ 'source_info' => {
+ 'line_nr' => 7
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'manual2'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'xref',
+ 'source_info' => {
+ 'line_nr' => 9
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'section_number' => '1'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 5
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'htmlxref_no_urlprefix_first'} = '@node top
+@top top
+
+@node chap
+@chapter Chap
+
+@xref{,,,manual}.
+
+@xref{,,,manual2}.
+
+';
+
+
+$result_texts{'htmlxref_no_urlprefix_first'} = 'top
+***
+
+1 Chap
+******
+
+.
+
+.
+
+';
+
+$result_sectioning{'htmlxref_no_urlprefix_first'} = {
+ 'extra' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'chap'
+ }
+ },
+ '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{'htmlxref_no_urlprefix_first'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'section_directions'}{'up'}
=
$result_sectioning{'htmlxref_no_urlprefix_first'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'htmlxref_no_urlprefix_first'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'prev'}
=
$result_sectioning{'htmlxref_no_urlprefix_first'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'htmlxref_no_urlprefix_first'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'up'}
=
$result_sectioning{'htmlxref_no_urlprefix_first'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'htmlxref_no_urlprefix_first'}{'extra'}{'section_childs'}[0]{'extra'}{'sectioning_root'}
= $result_sectioning{'htmlxref_no_urlprefix_first'};
+
+$result_nodes{'htmlxref_no_urlprefix_first'} = [
+ {
+ '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' => 'chap'
+ }
+ }
+ },
+ 'normalized' => 'Top'
+ }
+ },
+ {}
+];
+$result_nodes{'htmlxref_no_urlprefix_first'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'prev'}
= $result_nodes{'htmlxref_no_urlprefix_first'}[0];
+$result_nodes{'htmlxref_no_urlprefix_first'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'up'}
= $result_nodes{'htmlxref_no_urlprefix_first'}[0];
+$result_nodes{'htmlxref_no_urlprefix_first'}[1] =
$result_nodes{'htmlxref_no_urlprefix_first'}[0]{'extra'}{'node_directions'}{'next'};
+
+$result_menus{'htmlxref_no_urlprefix_first'} = [
+ {
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ {
+ 'extra' => {
+ 'normalized' => 'chap'
+ }
+ }
+];
+
+$result_errors{'htmlxref_no_urlprefix_first'} = [];
+
+
+$result_floats{'htmlxref_no_urlprefix_first'} = {};
+
+
+1;
diff --git
a/tp/t/results/htmlxref/htmlxref_no_urlprefix_first/res_html/chap.html
b/tp/t/results/htmlxref/htmlxref_no_urlprefix_first/res_html/chap.html
new file mode 100644
index 0000000000..07a90076fe
--- /dev/null
+++ b/tp/t/results/htmlxref/htmlxref_no_urlprefix_first/res_html/chap.html
@@ -0,0 +1,45 @@
+<!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>chap (top)</title>
+
+<meta name="description" content="chap (top)">
+<meta name="keywords" content="chap (top)">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="index.html" rel="start" title="top">
+<link href="index.html" rel="up" title="top">
+<link href="index.html" rel="prev" 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="chapter-level-extent" id="chap">
+<div class="nav-panel">
+<p>
+Previous: <a href="index.html" accesskey="p" rel="prev">top</a>, Up: <a
href="index.html" accesskey="u" rel="up">top</a> </p>
+</div>
+<hr>
+<h2 class="chapter" id="Chap"><span>1 Chap<a class="copiable-link"
href="#Chap"> ¶</a></span></h2>
+
+<p>See <a data-manual="manual" href="../manual_html/index.html">(manual)</a>.
+</p>
+<p>See <a data-manual="manual2" href="Here/index.html">(manual2)</a>.
+</p>
+</div>
+
+
+
+</body>
+</html>
diff --git
a/tp/t/results/htmlxref/htmlxref_no_urlprefix_first/res_html/index.html
b/tp/t/results/htmlxref/htmlxref_no_urlprefix_first/res_html/index.html
new file mode 100644
index 0000000000..75a1a9a363
--- /dev/null
+++ b/tp/t/results/htmlxref/htmlxref_no_urlprefix_first/res_html/index.html
@@ -0,0 +1,51 @@
+<!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">
+<link href="chap.html" rel="next" title="chap">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+td.menu-entry-description {vertical-align: top}
+td.menu-entry-destination {vertical-align: top}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a href="chap.html" accesskey="n" rel="next">Chap</a> </p>
+</div>
+<hr>
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top">
¶</a></span></h1>
+
+<table class="menu" border="0" cellspacing="0">
+<tr><td class="menu-entry-destination">• <a href="chap.html"
accesskey="1">chap</a>:</td><td> </td><td
class="menu-entry-description">
+</td></tr>
+</table>
+</div>
+<hr>
+<div class="nav-panel">
+<p>
+Next: <a href="chap.html" accesskey="n" rel="next">Chap</a> </p>
+</div>
+
+
+
+</body>
+</html>
diff --git a/tp/t/results/htmlxref/htmlxref_nodes.pl
b/tp/t/results/htmlxref/htmlxref_nodes.pl
index 3739f40e15..5f5eeb4a6b 100644
--- a/tp/t/results/htmlxref/htmlxref_nodes.pl
+++ b/tp/t/results/htmlxref/htmlxref_nodes.pl
@@ -2915,14 +2915,6 @@ $result_floats{'htmlxref_nodes'} = {};
$result_converted_errors{'file_html'}->{'htmlxref_nodes'} = [
- {
- 'error_line' => 'warning: missing section URL prefix for `manual\'
-',
- 'file_name' => 'htmlxref.cnf',
- 'line_nr' => 12,
- 'text' => 'missing section URL prefix for `manual\'',
- 'type' => 'warning'
- },
{
'error_line' => 'warning: unrecognized type: foo
',
diff --git a/tp/t/results/htmlxref/htmlxref_only_split.pl
b/tp/t/results/htmlxref/htmlxref_only_split.pl
index 4d67e76319..d873c6f0e0 100644
--- a/tp/t/results/htmlxref/htmlxref_only_split.pl
+++ b/tp/t/results/htmlxref/htmlxref_only_split.pl
@@ -2914,16 +2914,4 @@ $result_errors{'htmlxref_only_split'} = [];
$result_floats{'htmlxref_only_split'} = {};
-$result_converted_errors{'file_html'}->{'htmlxref_only_split'} = [
- {
- 'error_line' => 'warning: missing section URL prefix for `manual\'
-',
- 'file_name' => 'htmlxref-split.cnf',
- 'line_nr' => 1,
- 'text' => 'missing section URL prefix for `manual\'',
- 'type' => 'warning'
- }
-];
-
-
1;
diff --git a/tp/t/results/htmlxref/htmlxref_only_split_nodes.pl
b/tp/t/results/htmlxref/htmlxref_only_split_nodes.pl
index 1816f6d92d..a448174321 100644
--- a/tp/t/results/htmlxref/htmlxref_only_split_nodes.pl
+++ b/tp/t/results/htmlxref/htmlxref_only_split_nodes.pl
@@ -2914,16 +2914,4 @@ $result_errors{'htmlxref_only_split_nodes'} = [];
$result_floats{'htmlxref_only_split_nodes'} = {};
-$result_converted_errors{'file_html'}->{'htmlxref_only_split_nodes'} = [
- {
- 'error_line' => 'warning: missing section URL prefix for `manual\'
-',
- 'file_name' => 'htmlxref-split.cnf',
- 'line_nr' => 1,
- 'text' => 'missing section URL prefix for `manual\'',
- 'type' => 'warning'
- }
-];
-
-
1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files): no warning for an empty URL prefix as it is the only way to override an entry appearing in a file processed later on.,
Patrice Dumas <=