[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/init/epub3.pm, tp/init/chm.pm: use command_h
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/init/epub3.pm, tp/init/chm.pm: use command_href instead of doing the href from a separate file and target. |
Date: |
Tue, 01 Feb 2022 15:39:35 -0500 |
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 d8c4691bb5 * tp/init/epub3.pm, tp/init/chm.pm: use command_href
instead of doing the href from a separate file and target.
d8c4691bb5 is described below
commit d8c4691bb594d0bd3076f85fc9af6f8ae1d4ba56
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Feb 1 21:39:24 2022 +0100
* tp/init/epub3.pm, tp/init/chm.pm: use command_href instead
of doing the href from a separate file and target.
---
ChangeLog | 5 +++++
tp/init/chm.pm | 10 +++-------
tp/init/epub3.pm | 10 +++-------
tp/tests/layout/res_parser/formatting_chm/formatting.hhc | 14 +++++++-------
.../formatting_epub_package/EPUB/xhtml/nav_toc.xhtml | 14 +++++++-------
5 files changed, 25 insertions(+), 28 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6dd0cfa55b..b7347f1bc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-02-01 Patrice Dumas <pertusus@free.fr>
+
+ * tp/init/epub3.pm, tp/init/chm.pm: use command_href instead
+ of doing the href from a separate file and target.
+
2022-02-01 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm (command_filename): cache undef if
diff --git a/tp/init/chm.pm b/tp/init/chm.pm
index fe0bc39919..4f1ec82afa 100644
--- a/tp/init/chm.pm
+++ b/tp/init/chm.pm
@@ -327,13 +327,9 @@ sub chm_init($)
my $text = _chm_convert_tree_to_text($self, $section->{'args'}->[0]);
$text = Texinfo::Convert::Utils::numbered_heading($self, $section, $text,
$self->get_conf('NUMBER_SECTIONS'));
- my $file = $self->command_filename($section);
- my $target_command = $section;
- $target_command = $section->{'extra'}->{'associated_node'}
- if ($section->{'extra'} and $section->{'extra'}->{'associated_node'});
- my $target = $self->command_id($target_command);
- # FIXME use command_href instead?
- my $origin_href = "$file#$target";
+ # the empty string as second argument makes sure that the
+ # source file is different from the target file.
+ my $origin_href = $self->command_href($section, '');
print $hhc_fh "<LI> <OBJECT type=\"text/sitemap\">\n<param name=\"Name\"
value=\"$text\">\n<param name=\"Local\" value=\"$origin_href\">\n</OBJECT>
</LI>\n";
}
while ($level > $root_level) {
diff --git a/tp/init/epub3.pm b/tp/init/epub3.pm
index 3af339c64c..abc7642b56 100644
--- a/tp/init/epub3.pm
+++ b/tp/init/epub3.pm
@@ -468,13 +468,9 @@ EOT
my $text = _epub_convert_tree_to_text($self, $section->{'args'}->[0]);
$text = Texinfo::Convert::Utils::numbered_heading($self, $section, $text,
$self->get_conf('NUMBER_SECTIONS'));
- my $file = $self->command_filename($section);
- my $target_command = $section;
- $target_command = $section->{'extra'}->{'associated_node'}
- if ($section->{'extra'} and $section->{'extra'}->{'associated_node'});
- my $target = $self->command_id($target_command);
- # FIXME use command_href instead?
- my $origin_href = "$file#$target";
+ # the empty string as second argument makes sure that the
+ # source file is different from the target file.
+ my $origin_href = $self->command_href($section, '');
print $nav_fh " " x $level . "<li><a href=\"$origin_href\">$text</a>";
}
if ($level > $root_level) {
diff --git a/tp/tests/layout/res_parser/formatting_chm/formatting.hhc
b/tp/tests/layout/res_parser/formatting_chm/formatting.hhc
index 8906775f1e..bdc3260779 100644
--- a/tp/tests/layout/res_parser/formatting_chm/formatting.hhc
+++ b/tp/tests/layout/res_parser/formatting_chm/formatting.hhc
@@ -11,37 +11,37 @@
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Top section">
-<param name="Local" value="formatting.html#Top">
+<param name="Local" value="formatting.html">
</OBJECT> </LI>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="1 chapter">
-<param name="Local" value="chapter.html#chapter">
+<param name="Local" value="chapter.html">
</OBJECT> </LI>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="1.1 A section">
-<param name="Local" value="s_002d_002dect_002cion.html#s_002d_002dect_002cion">
+<param name="Local" value="s_002d_002dect_002cion.html">
</OBJECT> </LI>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="1.1.1 subsection">
-<param name="Local" value="subsection.html#subsection">
+<param name="Local" value="subsection.html">
</OBJECT> </LI>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="1.1.1.1 subsubsection "simple-double-">
-<param name="Local"
value="subsubsection-_0060_0060simple_002ddouble_002d_002d.html#subsubsection-_0060_0060simple_002ddouble_002d_002d">
+<param name="Local"
value="subsubsection-_0060_0060simple_002ddouble_002d_002d.html">
</OBJECT> </LI>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="1.1.1.2 three--four---"">
-<param name="Local"
value="subsubsection-three_002d_002d_002dfour_002d_002d_002d_002d_0027_0027.html#subsubsection-three_002d_002d_002dfour_002d_002d_002d_002d_0027_0027">
+<param name="Local"
value="subsubsection-three_002d_002d_002dfour_002d_002d_002d_002d_0027_0027.html">
</OBJECT> </LI>
</UL>
</UL>
</UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="chapter 2">
-<param name="Local" value="chapter2.html#chapter2">
+<param name="Local" value="chapter2.html">
</OBJECT> </LI>
</UL>
</HTML>
diff --git
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/nav_toc.xhtml
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/nav_toc.xhtml
index a764289c7f..d37dd39a11 100644
---
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/nav_toc.xhtml
+++
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/xhtml/nav_toc.xhtml
@@ -9,22 +9,22 @@
<h1>Table of contents</h1>
<ol>
- <li><a href="formatting.xhtml#Top">Top section</a></li>
- <li><a href="chapter.xhtml#chapter">1 chapter</a>
+ <li><a href="formatting.xhtml">Top section</a></li>
+ <li><a href="chapter.xhtml">1 chapter</a>
<ol>
- <li><a href="s_002d_002dect_002cion.xhtml#s_002d_002dect_002cion">1.1 A
section</a>
+ <li><a href="s_002d_002dect_002cion.xhtml">1.1 A section</a>
<ol>
- <li><a href="subsection.xhtml#subsection">1.1.1 subsection</a>
+ <li><a href="subsection.xhtml">1.1.1 subsection</a>
<ol>
- <li><a
href="subsubsection-_0060_0060simple_002ddouble_002d_002d.xhtml#subsubsection-_0060_0060simple_002ddouble_002d_002d">1.1.1.1
subsubsection "simple-double-</a></li>
- <li><a
href="subsubsection-three_002d_002d_002dfour_002d_002d_002d_002d_0027_0027.xhtml#subsubsection-three_002d_002d_002dfour_002d_002d_002d_002d_0027_0027">1.1.1.2
three--four---"</a></li>
+ <li><a
href="subsubsection-_0060_0060simple_002ddouble_002d_002d.xhtml">1.1.1.1
subsubsection "simple-double-</a></li>
+ <li><a
href="subsubsection-three_002d_002d_002dfour_002d_002d_002d_002d_0027_0027.xhtml">1.1.1.2
three--four---"</a></li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
- <li><a href="chapter2.xhtml#chapter2">chapter 2</a></li>
+ <li><a href="chapter2.xhtml">chapter 2</a></li>
</ol>
</nav>
</body>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/init/epub3.pm, tp/init/chm.pm: use command_href instead of doing the href from a separate file and target.,
Patrice Dumas <=