texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Do not remove .inf or .info from manual name for


From: Patrice Dumas
Subject: branch master updated: Do not remove .inf or .info from manual name for HTML cross references
Date: Sun, 21 Jan 2024 14:58:50 -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 1b759ceda5 Do not remove .inf or .info from manual name for HTML cross 
references
1b759ceda5 is described below

commit 1b759ceda56495ba631274b09d9a563b9cca598c
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jan 21 20:58:37 2024 +0100

    Do not remove .inf or .info from manual name for HTML cross references
    
    * NEWS, tp/Texinfo/Convert/HTML.pm (_external_node_href),
    tp/Texinfo/XS/convert/convert_html.c (external_node_href): do not
    remove a .inf or .info at the end of manual name argument for
    cross-references to external nodes.  This is not done for other
    formats, does not comply with the HTML cross references specification
    and is probably a remnant of times long gone.
---
 ChangeLog                                               | 11 +++++++++++
 NEWS                                                    |  3 +++
 tp/TODO                                                 |  4 ----
 tp/Texinfo/Convert/HTML.pm                              |  1 -
 tp/Texinfo/XS/convert/convert_html.c                    | 17 -----------------
 tp/t/results/html_tests/check_htmlxref.pl               |  8 ++++----
 .../html_tests/check_htmlxref_ignore_ref_top_up.pl      |  8 ++++----
 .../check_htmlxref_menu/res_html/chapter.html           |  2 +-
 .../html_tests/check_htmlxref_menu/res_html/first.html  |  4 ++--
 .../html_tests/check_htmlxref_menu/res_html/index.html  |  4 ++--
 .../check_htmlxref_no_use_nodes/res_html/chapter.html   |  2 +-
 .../check_htmlxref_no_use_nodes/res_html/index.html     |  4 ++--
 12 files changed, 30 insertions(+), 38 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9e4bcdf8c4..5656c0836c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-01-21  Patrice Dumas  <pertusus@free.fr>
+
+       Do not remove .inf or .info from manual name for HTML cross references
+
+       * NEWS, tp/Texinfo/Convert/HTML.pm (_external_node_href),
+       tp/Texinfo/XS/convert/convert_html.c (external_node_href): do not
+       remove a .inf or .info at the end of manual name argument for
+       cross-references to external nodes.  This is not done for other
+       formats, does not comply with the HTML cross references specification
+       and is probably a remnant of times long gone.
+
 2024-01-21  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/Converter.pm (output_tree)
diff --git a/NEWS b/NEWS
index ec46386156..fd56de7490 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,9 @@ See the manual for detailed information.
  . HTML, Texinfo and raw text output:
    An implementation of the conversion in C has been included.  Set the
     `TEXINFO_XS_CONVERT' environment variable to 1 to use.
+ . HTML:
+   . Do not remove .inf or .info at the end of manual name for
+     cross-references to external nodes anymore.
 
 * info
  . check for init file under ~/.config/texinfo/infokey before checking
diff --git a/tp/TODO b/tp/TODO
index 7a3454bdbc..5a21919983 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -12,10 +12,6 @@ Before next release
 
 Keep/document *XS_EXTERNAL_FORMATTING *XS_EXTERNAL_CONVERSION?
 
-it is not documented that .info or .inf at the end of the @ref file name 
argument of the source cross reference command is ignored when doing the HTML 
cross ref.
-in HTML Cross-reference Link Basics:
-Any directory part in the file name argument of the source cross reference 
command is ignored. Thus, @xref{,,,../foo} and @xref{,,,foo} both use ‘foo’ as 
the manual name. This is because any such attempted hardwiring of the directory 
is very unlikely to be useful for all the output formats that use the manual 
name. 
-
 Document that Texinfo::Document::rebuild_document or
 Texinfo::Document::rebuild_tree should be called after tree modifications
 if the parser is XS but converters are perl.
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 6507917107..fb6892c007 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -10486,7 +10486,6 @@ sub _external_node_href($$$)
       }
     }
     my $manual_base = $manual_name;
-    $manual_base =~ s/\.info?$//;
     $manual_base =~ s/^.*\///;
     my $split_found;
     my $htmlxref_href;
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index a3b1fa0301..8f9c680fde 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -3085,11 +3085,8 @@ external_node_href (CONVERTER *self, const ELEMENT 
*external_node,
       char *manual_name;
       char *manual_base = 0;
       char *p;
-      char *q = 0;
       char *htmlxref_href = 0;
-      char saved;
       enum htmlxref_split_type split_found = htmlxref_split_type_none;
-      int manual_len;
       HTMLXREF_MANUAL *htmlxref_manual;
 
       self->convert_text_options->code_state++;
@@ -3120,21 +3117,7 @@ external_node_href (CONVERTER *self, const ELEMENT 
*external_node,
         p = manual_name;
       else
         p++;
-      manual_len = strlen (manual_name);
-      if (manual_len >= 5
-          && !memcmp (manual_name +manual_len - 5, ".info", 5))
-        q = manual_name +manual_len - 5;
-      else if (manual_len >= 4
-               && !memcmp (manual_name +manual_len - 4, ".inf", 4))
-        q = manual_name +manual_len - 4;
-      if (q)
-        {
-          saved = *q;
-          *q = '\0';
-        }
       manual_base = strdup (p);
-      if (q)
-        *q = saved;
 
       htmlxref_manual = find_htmlxref_manual (&self->htmlxref, manual_base);
 
diff --git a/tp/t/results/html_tests/check_htmlxref.pl 
b/tp/t/results/html_tests/check_htmlxref.pl
index 8aaa2bd9dc..b0d09297f7 100644
--- a/tp/t/results/html_tests/check_htmlxref.pl
+++ b/tp/t/results/html_tests/check_htmlxref.pl
@@ -981,8 +981,8 @@ Next: <a href="no_existing_no_manual_direction.html#Top" 
accesskey="n" rel="next
 </div>
 <h1 class="top" id="top"><span>top<a class="copiable-link" href="#top"> 
&para;</a></span></h1>
 
-<p><a data-manual="no_existing_no_manual.info" 
href="no_existing_no_manual.html#a">c</a>
-<a data-manual="no_existing_no_manual.info" 
href="no_existing_no_manual.html#a">c</a>
+<p><a data-manual="no_existing_no_manual.info" 
href="no_existing_no_manual.info.html#a">c</a>
+<a data-manual="no_existing_no_manual.info" 
href="no_existing_no_manual.info.html#a">c</a>
 </p>
 
 <ul class="mini-toc">
@@ -991,7 +991,7 @@ Next: <a href="no_existing_no_manual_direction.html#Top" 
accesskey="n" rel="next
 <hr>
 <a class="node-id" id="first"></a><div class="nav-panel">
 <p>
-Next: <a href="no_existing_no_manual.html#Top" accesskey="n" 
rel="next">(no_existing_no_manual.info)</a> &nbsp; </p>
+Next: <a href="no_existing_no_manual.info.html#Top" accesskey="n" 
rel="next">(no_existing_no_manual.info)</a> &nbsp; </p>
 </div>
 <h4 class="node"><span>first<a class="copiable-link" href="#first"> 
&para;</a></span></h4>
 
@@ -1003,7 +1003,7 @@ Next: <a href="chap_not_existing.html#Top" accesskey="n" 
rel="next">(chap_not_ex
 </div>
 <h2 class="chapter" id="Chapter"><span>1 Chapter<a class="copiable-link" 
href="#Chapter"> &para;</a></span></h2>
 
-<p>See <a data-manual="some_name_inf.inf" 
href="some_name_inf.html#aa">(some_name_inf.inf)aa</a>.
+<p>See <a data-manual="some_name_inf.inf" 
href="some_name_inf.inf.html#aa">(some_name_inf.inf)aa</a>.
 </p></div>
 </div>
 
diff --git a/tp/t/results/html_tests/check_htmlxref_ignore_ref_top_up.pl 
b/tp/t/results/html_tests/check_htmlxref_ignore_ref_top_up.pl
index 145ee3f1ad..d761e36a16 100644
--- a/tp/t/results/html_tests/check_htmlxref_ignore_ref_top_up.pl
+++ b/tp/t/results/html_tests/check_htmlxref_ignore_ref_top_up.pl
@@ -981,8 +981,8 @@ Next: <a href="no_existing_no_manual_direction.html#Top" 
accesskey="n" rel="next
 </div>
 <h1 class="top" id="top"><span>top<a class="copiable-link" href="#top"> 
&para;</a></span></h1>
 
-<p><a data-manual="no_existing_no_manual.info" 
href="no_existing_no_manual.html#a">c</a>
-<a data-manual="no_existing_no_manual.info" 
href="no_existing_no_manual.html#a">c</a>
+<p><a data-manual="no_existing_no_manual.info" 
href="no_existing_no_manual.info.html#a">c</a>
+<a data-manual="no_existing_no_manual.info" 
href="no_existing_no_manual.info.html#a">c</a>
 </p>
 
 <ul class="mini-toc">
@@ -991,7 +991,7 @@ Next: <a href="no_existing_no_manual_direction.html#Top" 
accesskey="n" rel="next
 <hr>
 <a class="node-id" id="first"></a><div class="nav-panel">
 <p>
-Next: <a href="no_existing_no_manual.html#Top" accesskey="n" 
rel="next">(no_existing_no_manual.info)</a> &nbsp; </p>
+Next: <a href="no_existing_no_manual.info.html#Top" accesskey="n" 
rel="next">(no_existing_no_manual.info)</a> &nbsp; </p>
 </div>
 <h4 class="node"><span>first<a class="copiable-link" href="#first"> 
&para;</a></span></h4>
 
@@ -1003,7 +1003,7 @@ Next: <a href="chap_not_existing.html#Top" accesskey="n" 
rel="next">(chap_not_ex
 </div>
 <h2 class="chapter" id="Chapter"><span>1 Chapter<a class="copiable-link" 
href="#Chapter"> &para;</a></span></h2>
 
-<p>See <a data-manual="some_name_inf.inf" 
href="some_name_inf.html#aa">(some_name_inf.inf)aa</a>.
+<p>See <a data-manual="some_name_inf.inf" 
href="some_name_inf.inf.html#aa">(some_name_inf.inf)aa</a>.
 </p></div>
 </div>
 
diff --git a/tp/t/results/html_tests/check_htmlxref_menu/res_html/chapter.html 
b/tp/t/results/html_tests/check_htmlxref_menu/res_html/chapter.html
index eda96a3a28..acc93ae265 100644
--- a/tp/t/results/html_tests/check_htmlxref_menu/res_html/chapter.html
+++ b/tp/t/results/html_tests/check_htmlxref_menu/res_html/chapter.html
@@ -33,7 +33,7 @@ Next: <a href="../chap_not_existing_html/index.html" 
accesskey="n" rel="next">(c
 <hr>
 <h2 class="chapter" id="Chapter"><span>1 Chapter<a class="copiable-link" 
href="#Chapter"> &para;</a></span></h2>
 
-<p>See <a data-manual="some_name_inf.inf" 
href="../some_name_inf_html/aa.html#aa">(some_name_inf.inf)aa</a>.
+<p>See <a data-manual="some_name_inf.inf" 
href="../some_name_inf.inf_html/aa.html#aa">(some_name_inf.inf)aa</a>.
 </p></div>
 
 
diff --git a/tp/t/results/html_tests/check_htmlxref_menu/res_html/first.html 
b/tp/t/results/html_tests/check_htmlxref_menu/res_html/first.html
index 3f5b7ea790..40a41340b6 100644
--- a/tp/t/results/html_tests/check_htmlxref_menu/res_html/first.html
+++ b/tp/t/results/html_tests/check_htmlxref_menu/res_html/first.html
@@ -12,7 +12,7 @@
 <meta name="viewport" content="width=device-width,initial-scale=1">
 
 <link href="index.html" rel="start" title="Top">
-<link href="../no_existing_no_manual_html/index.html" rel="next" 
title="(no_existing_no_manual.info)">
+<link href="../no_existing_no_manual.info_html/index.html" rel="next" 
title="(no_existing_no_manual.info)">
 <style type="text/css">
 <!--
 a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
@@ -26,7 +26,7 @@ span:hover a.copiable-link {visibility: visible}
 <body lang="en">
 <a class="node-id" id="first"></a><div class="nav-panel">
 <p>
-Next: <a href="../no_existing_no_manual_html/index.html" accesskey="n" 
rel="next">(no_existing_no_manual.info)</a> &nbsp; </p>
+Next: <a href="../no_existing_no_manual.info_html/index.html" accesskey="n" 
rel="next">(no_existing_no_manual.info)</a> &nbsp; </p>
 </div>
 <hr>
 <h4 class="node"><span>first<a class="copiable-link" href="#first"> 
&para;</a></span></h4>
diff --git a/tp/t/results/html_tests/check_htmlxref_menu/res_html/index.html 
b/tp/t/results/html_tests/check_htmlxref_menu/res_html/index.html
index 99cd6ebacb..3e1788056d 100644
--- a/tp/t/results/html_tests/check_htmlxref_menu/res_html/index.html
+++ b/tp/t/results/html_tests/check_htmlxref_menu/res_html/index.html
@@ -36,8 +36,8 @@ Next: <a 
href="../no_existing_no_manual_direction_html/index.html" accesskey="n"
 <hr>
 <h1 class="top" id="top"><span>top<a class="copiable-link" href="#top"> 
&para;</a></span></h1>
 
-<p><a data-manual="no_existing_no_manual.info" 
href="../no_existing_no_manual_html/a.html#a">c</a>
-<a data-manual="no_existing_no_manual.info" 
href="../no_existing_no_manual_html/a.html#a">c</a>
+<p><a data-manual="no_existing_no_manual.info" 
href="../no_existing_no_manual.info_html/a.html#a">c</a>
+<a data-manual="no_existing_no_manual.info" 
href="../no_existing_no_manual.info_html/a.html#a">c</a>
 </p>
 <table class="menu" border="0" cellspacing="0">
 <tr><td class="menu-entry-destination">&bull; <a href="first.html" 
accesskey="1">first</a>:</td><td>&nbsp;&nbsp;</td><td 
class="menu-entry-description">
diff --git 
a/tp/t/results/html_tests/check_htmlxref_no_use_nodes/res_html/chapter.html 
b/tp/t/results/html_tests/check_htmlxref_no_use_nodes/res_html/chapter.html
index 30de5484de..f106c3bc03 100644
--- a/tp/t/results/html_tests/check_htmlxref_no_use_nodes/res_html/chapter.html
+++ b/tp/t/results/html_tests/check_htmlxref_no_use_nodes/res_html/chapter.html
@@ -33,7 +33,7 @@ span:hover a.copiable-link {visibility: visible}
 <hr>
 <h2 class="chapter" id="Chapter"><span>1 Chapter<a class="copiable-link" 
href="#Chapter"> &para;</a></span></h2>
 
-<p>See <a data-manual="some_name_inf.inf" 
href="../some_name_inf_html/aa.html#aa">(some_name_inf.inf)aa</a>.
+<p>See <a data-manual="some_name_inf.inf" 
href="../some_name_inf.inf_html/aa.html#aa">(some_name_inf.inf)aa</a>.
 </p></div>
 
 
diff --git 
a/tp/t/results/html_tests/check_htmlxref_no_use_nodes/res_html/index.html 
b/tp/t/results/html_tests/check_htmlxref_no_use_nodes/res_html/index.html
index 19dfe9284e..e75cdad8f9 100644
--- a/tp/t/results/html_tests/check_htmlxref_no_use_nodes/res_html/index.html
+++ b/tp/t/results/html_tests/check_htmlxref_no_use_nodes/res_html/index.html
@@ -32,8 +32,8 @@ span:hover a.copiable-link {visibility: visible}
 <hr>
 <h1 class="top" id="top"><span>top<a class="copiable-link" href="#top"> 
&para;</a></span></h1>
 
-<p><a data-manual="no_existing_no_manual.info" 
href="../no_existing_no_manual_html/a.html#a">c</a>
-<a data-manual="no_existing_no_manual.info" 
href="../no_existing_no_manual_html/a.html#a">c</a>
+<p><a data-manual="no_existing_no_manual.info" 
href="../no_existing_no_manual.info_html/a.html#a">c</a>
+<a data-manual="no_existing_no_manual.info" 
href="../no_existing_no_manual.info_html/a.html#a">c</a>
 </p>
 
 <ul class="mini-toc">



reply via email to

[Prev in Thread] Current Thread [Next in Thread]