[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/Plaintext.pm (_convert): add
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/Plaintext.pm (_convert): add a Top node in cross-ref when there is a file but no node, as the Texinfo Info reader cannot follow a cross-reference with a file but no node name. Gavin report. |
Date: |
Tue, 02 Apr 2024 18:25:32 -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 a194c33757 * tp/Texinfo/Convert/Plaintext.pm (_convert): add a Top
node in cross-ref when there is a file but no node, as the Texinfo Info reader
cannot follow a cross-reference with a file but no node name. Gavin report.
a194c33757 is described below
commit a194c33757c57987933f8bb53236d6e5f56c189f
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Apr 3 00:25:13 2024 +0200
* tp/Texinfo/Convert/Plaintext.pm (_convert): add a Top node in
cross-ref when there is a file but no node, as the Texinfo Info reader
cannot follow a cross-reference with a file but no node name. Gavin
report.
---
ChangeLog | 7 ++
tp/Texinfo/Convert/Plaintext.pm | 13 +-
.../converters_tests/ref_error_formatting.pl | 25 ++--
tp/t/results/converters_tests/ref_in_sectioning.pl | 24 ++--
.../res_parser/formatting_info/formatting.info | 136 ++++++++++-----------
.../res_parser/formatting_plaintext/formatting.txt | 78 ++++++------
.../res_parser/formatting_fr_info/formatting.info | 136 ++++++++++-----------
.../formatting.info | 136 ++++++++++-----------
.../formatting.info | 136 ++++++++++-----------
.../formatting.txt | 78 ++++++------
10 files changed, 394 insertions(+), 375 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index df44defeae..d48bd248bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-04-02 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/Plaintext.pm (_convert): add a Top node in
+ cross-ref when there is a file but no node, as the Texinfo Info reader
+ cannot follow a cross-reference with a file but no node name. Gavin
+ report.
+
2024-04-02 Patrice Dumas <pertusus@free.fr>
Remove AVOID_MENU_REDUNDANCY customization option
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 6ed3e5b76b..c4f1fe0cef 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -2544,7 +2544,8 @@ sub _convert($$)
{'text' => ')'},]};
} elsif (defined($args[4])) {
# add a () such that the node is considered to be external,
- # even though the manual name is not known.
+ # even though the manual name is not known. This should only
+ # happen if a book argument is given, but no manual name.
$file = {'text' => '()'};
}
@@ -2614,6 +2615,16 @@ sub _convert($$)
'no_added_eol' => 1});
$self->{'silent'}--;
}
+ if (defined($file) and $node_name !~ /\S/) {
+ # Some Info reader versions, at least the Info reader from
+ # Texinfo 6.8 and 7.1 cannot follow a cross-reference
+ # consisting only of a manual name, such as *Note (manual)::.
+ # The Emacs Info reader does not seem to have this problem.
+ # Add a Top node to have a node name.
+ # Should probably be removed about 10-15 years after Info
+ # reader have been fixed.
+ $label_element = {'text' => 'Top'};
+ }
my $check_chars;
if ($name) {
diff --git a/tp/t/results/converters_tests/ref_error_formatting.pl
b/tp/t/results/converters_tests/ref_error_formatting.pl
index ab827981be..b45feea1fb 100644
--- a/tp/t/results/converters_tests/ref_error_formatting.pl
+++ b/tp/t/results/converters_tests/ref_error_formatting.pl
@@ -2940,8 +2940,8 @@ $result_floats{'ref_error_formatting'} = {};
$result_converted{'plaintext'}->{'ref_error_formatting'} = '‘@ref{node}’ *note
node::
‘@ref{,cross ref name}’ *note cross ref name: . ‘@ref{,,title}’ *note
-title: . ‘@ref{,,,file name}’ *note (file name):: ‘@ref{,,,,manual}’
-*note ():: ‘@ref{node,cross ref name}’ *note cross ref name: node.
+title: . ‘@ref{,,,file name}’ *note (file name)Top:: ‘@ref{,,,,manual}’
+*note ()Top:: ‘@ref{node,cross ref name}’ *note cross ref name: node.
‘@ref{node,,title}’ *note title: node. ‘@ref{node,,,file name}’ *note
(file name)node:: ‘@ref{node,,,,manual}’ *note ()node:: ‘@ref{node,cross
ref name,title,}’ *note cross ref name: node. ‘@ref{node,cross ref
@@ -2955,18 +2955,19 @@ title: (file name)node. ‘@ref{node,,title,,manual}’
*note title: ()node.
‘@ref{node,,title, file name, manual}’ *note title: (file name)node.
‘@ref{node,,,file name,manual}’ *note (file name)node:: ‘@ref{,cross ref
name,title,}’ *note cross ref name: . ‘@ref{,cross ref name,,file name}’
-*note cross ref name: (file name). ‘@ref{,cross ref name,,,manual}’
-*note cross ref name: (). ‘@ref{,cross ref name,title,file name}’ *note
-cross ref name: (file name). ‘@ref{,cross ref name,title,,manual}’ *note
-cross ref name: (). ‘@ref{,cross ref name,title, file name, manual}’
-*note cross ref name: (file name). ‘@ref{,,title,file name}’ *note
-title: (file name). ‘@ref{,,title,,manual}’ *note title: ().
-‘@ref{,,title, file name, manual}’ *note title: (file name).
-‘@ref{,,,file name,manual}’ *note (file name)::
+*note cross ref name: (file name)Top. ‘@ref{,cross ref name,,,manual}’
+*note cross ref name: ()Top. ‘@ref{,cross ref name,title,file name}’
+*note cross ref name: (file name)Top. ‘@ref{,cross ref
+name,title,,manual}’ *note cross ref name: ()Top. ‘@ref{,cross ref
+name,title, file name, manual}’ *note cross ref name: (file name)Top.
+‘@ref{,,title,file name}’ *note title: (file name)Top.
+‘@ref{,,title,,manual}’ *note title: ()Top. ‘@ref{,,title, file name,
+manual}’ *note title: (file name)Top. ‘@ref{,,,file name,manual}’ *note
+(file name)Top::
‘@inforef{,cross ref name }’ *note cross ref name: . ‘@inforef{,,file
-name}’ *note (file name):: ‘@inforef{,cross ref name, file name}’ *note
-cross ref name: (file name). ‘@inforef{}’ *note ::
+name}’ *note (file name)Top:: ‘@inforef{,cross ref name, file name}’
+*note cross ref name: (file name)Top. ‘@inforef{}’ *note ::
‘@inforef{node, cross ref name, file name}’ *note cross ref name:
(file name)node. ‘@inforef{node}’ *note node:: ‘@inforef{node, cross ref
diff --git a/tp/t/results/converters_tests/ref_in_sectioning.pl
b/tp/t/results/converters_tests/ref_in_sectioning.pl
index 6afe482b9d..abaeafe44e 100644
--- a/tp/t/results/converters_tests/ref_in_sectioning.pl
+++ b/tp/t/results/converters_tests/ref_in_sectioning.pl
@@ -2173,13 +2173,13 @@ $result_converted{'plaintext'}->{'ref_in_sectioning'} =
'for example *note node:
2.4 *note (file name)node:: code node, file name
2.5 *note ()node:: node and manual
2.6 *note ()Top:: Top and manual
- 2.7 *note ():: no node just manual
- 2.8 *note (file name):: no node just file name
+ 2.7 *note ()Top:: no node just manual
+ 2.8 *note (file name)Top:: no node just file name
2.9 *note b: (c)a. inforef a b c
2.10 (*note (file name)Top::) pxref Top file name, spaces
- 2.11 (*note (file name)::) pxref file name only, spaces
+ 2.11 (*note (file name)Top::) pxref file name only, spaces
2.12 *Note (filename)Top::, xref Top filename only, no spaces
- 2.13 *Note (filename)::. xref filename only, no spaces
+ 2.13 *Note (filename)Top::. xref filename only, no spaces
for example *note node:: (*note node::) (*note (file)Top::)
***********************************************************
@@ -2208,11 +2208,11 @@ for example *note node:: (*note node::) (*note
(file)Top::)
2.6 *note ()Top:: Top and manual
================================
-2.7 *note ():: no node just manual
-==================================
+2.7 *note ()Top:: no node just manual
+=====================================
-2.8 *note (file name):: no node just file name
-==============================================
+2.8 *note (file name)Top:: no node just file name
+=================================================
2.9 *note b: (c)a. inforef a b c
================================
@@ -2220,14 +2220,14 @@ for example *note node:: (*note node::) (*note
(file)Top::)
2.10 (*note (file name)Top::) pxref Top file name, spaces
=========================================================
-2.11 (*note (file name)::) pxref file name only, spaces
-=======================================================
+2.11 (*note (file name)Top::) pxref file name only, spaces
+==========================================================
2.12 *Note (filename)Top::, xref Top filename only, no spaces
=============================================================
-2.13 *Note (filename)::. xref filename only, no spaces
-======================================================
+2.13 *Note (filename)Top::. xref filename only, no spaces
+=========================================================
';
diff --git a/tp/tests/coverage/res_parser/formatting_info/formatting.info
b/tp/tests/coverage/res_parser/formatting_info/formatting.info
index f3ce1742e9..276cfa56a7 100644
--- a/tp/tests/coverage/res_parser/formatting_info/formatting.info
+++ b/tp/tests/coverage/res_parser/formatting_info/formatting.info
@@ -667,8 +667,8 @@ b
‘@ref{node}’ *note node::
‘@ref{,cross ref name}’ *note cross ref name: . ‘@ref{,,title}’ *note
-title: . ‘@ref{,,,file name}’ *note (file name):: ‘@ref{,,,,manual}’
-*note ():: ‘@ref{node,cross ref name}’ *note cross ref name: node.
+title: . ‘@ref{,,,file name}’ *note (file name)Top:: ‘@ref{,,,,manual}’
+*note ()Top:: ‘@ref{node,cross ref name}’ *note cross ref name: node.
‘@ref{node,,title}’ *note title: node. ‘@ref{node,,,file name}’ *note
(file name)node:: ‘@ref{node,,,,manual}’ *note ()node:: ‘@ref{node,cross
ref name,title,}’ *note cross ref name: node. ‘@ref{node,cross ref
@@ -683,19 +683,19 @@ title: (file name)node. ‘@ref{node,,title,,manual}’ *note
title: ()node.
name)chapter. ‘@ref{node,,title, file name, manual}’ *note title: (file
name)node. ‘@ref{node,,,file name,manual}’ *note (file name)node::
‘@ref{,cross ref name,title,}’ *note cross ref name: . ‘@ref{,cross ref
-name,,file name}’ *note cross ref name: (file name). ‘@ref{,cross ref
-name,,,manual}’ *note cross ref name: (). ‘@ref{,cross ref
-name,title,file name}’ *note cross ref name: (file name). ‘@ref{,cross
-ref name,title,,manual}’ *note cross ref name: (). ‘@ref{,cross ref
-name,title, file name, manual}’ *note cross ref name: (file name).
-‘@ref{,,title,file name}’ *note title: (file name).
-‘@ref{,,title,,manual}’ *note title: (). ‘@ref{,,title, file name,
-manual}’ *note title: (file name). ‘@ref{,,,file name,manual}’ *note
-(file name)::
+name,,file name}’ *note cross ref name: (file name)Top. ‘@ref{,cross ref
+name,,,manual}’ *note cross ref name: ()Top. ‘@ref{,cross ref
+name,title,file name}’ *note cross ref name: (file name)Top.
+‘@ref{,cross ref name,title,,manual}’ *note cross ref name: ()Top.
+‘@ref{,cross ref name,title, file name, manual}’ *note cross ref name:
+(file name)Top. ‘@ref{,,title,file name}’ *note title: (file name)Top.
+‘@ref{,,title,,manual}’ *note title: ()Top. ‘@ref{,,title, file name,
+manual}’ *note title: (file name)Top. ‘@ref{,,,file name,manual}’ *note
+(file name)Top::
‘@inforef{,cross ref name }’ *note cross ref name: . ‘@inforef{,,file
-name}’ *note (file name):: ‘@inforef{,cross ref name, file name}’ *note
-cross ref name: (file name). ‘@inforef{}’ *note ::
+name}’ *note (file name)Top:: ‘@inforef{,cross ref name, file name}’
+*note cross ref name: (file name)Top. ‘@inforef{}’ *note ::
---------- Footnotes ----------
@@ -1406,8 +1406,8 @@ b
‘@ref{node}’ *note node::
‘@ref{,cross ref name}’ *note cross ref name: . ‘@ref{,,title}’ *note
-title: . ‘@ref{,,,file name}’ *note (file name):: ‘@ref{,,,,manual}’
-*note ():: ‘@ref{node,cross ref name}’ *note cross ref name: node.
+title: . ‘@ref{,,,file name}’ *note (file name)Top:: ‘@ref{,,,,manual}’
+*note ()Top:: ‘@ref{node,cross ref name}’ *note cross ref name: node.
‘@ref{node,,title}’ *note title: node. ‘@ref{node,,,file name}’ *note
(file name)node:: ‘@ref{node,,,,manual}’ *note ()node:: ‘@ref{node,cross
ref name,title,}’ *note cross ref name: node. ‘@ref{node,cross ref
@@ -1422,19 +1422,19 @@ title: (file name)node. ‘@ref{node,,title,,manual}’
*note title: ()node.
name)chapter. ‘@ref{node,,title, file name, manual}’ *note title: (file
name)node. ‘@ref{node,,,file name,manual}’ *note (file name)node::
‘@ref{,cross ref name,title,}’ *note cross ref name: . ‘@ref{,cross ref
-name,,file name}’ *note cross ref name: (file name). ‘@ref{,cross ref
-name,,,manual}’ *note cross ref name: (). ‘@ref{,cross ref
-name,title,file name}’ *note cross ref name: (file name). ‘@ref{,cross
-ref name,title,,manual}’ *note cross ref name: (). ‘@ref{,cross ref
-name,title, file name, manual}’ *note cross ref name: (file name).
-‘@ref{,,title,file name}’ *note title: (file name).
-‘@ref{,,title,,manual}’ *note title: (). ‘@ref{,,title, file name,
-manual}’ *note title: (file name). ‘@ref{,,,file name,manual}’ *note
-(file name)::
+name,,file name}’ *note cross ref name: (file name)Top. ‘@ref{,cross ref
+name,,,manual}’ *note cross ref name: ()Top. ‘@ref{,cross ref
+name,title,file name}’ *note cross ref name: (file name)Top.
+‘@ref{,cross ref name,title,,manual}’ *note cross ref name: ()Top.
+‘@ref{,cross ref name,title, file name, manual}’ *note cross ref name:
+(file name)Top. ‘@ref{,,title,file name}’ *note title: (file name)Top.
+‘@ref{,,title,,manual}’ *note title: ()Top. ‘@ref{,,title, file name,
+manual}’ *note title: (file name)Top. ‘@ref{,,,file name,manual}’ *note
+(file name)Top::
‘@inforef{,cross ref name }’ *note cross ref name: . ‘@inforef{,,file
-name}’ *note (file name):: ‘@inforef{,cross ref name, file name}’ *note
-cross ref name: (file name). ‘@inforef{}’ *note ::
+name}’ *note (file name)Top:: ‘@inforef{,cross ref name, file name}’
+*note cross ref name: (file name)Top. ‘@inforef{}’ *note ::
Normal text
@@ -2102,8 +2102,8 @@ b
‘@ref{node}’ *note node::
‘@ref{,cross ref name}’ *note cross ref name: . ‘@ref{,,title}’ *note
-title: . ‘@ref{,,,file name}’ *note (file name):: ‘@ref{,,,,manual}’
-*note ():: ‘@ref{node,cross ref name}’ *note cross ref name: node.
+title: . ‘@ref{,,,file name}’ *note (file name)Top:: ‘@ref{,,,,manual}’
+*note ()Top:: ‘@ref{node,cross ref name}’ *note cross ref name: node.
‘@ref{node,,title}’ *note title: node. ‘@ref{node,,,file name}’ *note
(file name)node:: ‘@ref{node,,,,manual}’ *note ()node:: ‘@ref{node,cross
ref name,title,}’ *note cross ref name: node. ‘@ref{node,cross ref
@@ -2118,19 +2118,19 @@ title: (file name)node. ‘@ref{node,,title,,manual}’
*note title: ()node.
name)chapter. ‘@ref{node,,title, file name, manual}’ *note title: (file
name)node. ‘@ref{node,,,file name,manual}’ *note (file name)node::
‘@ref{,cross ref name,title,}’ *note cross ref name: . ‘@ref{,cross ref
-name,,file name}’ *note cross ref name: (file name). ‘@ref{,cross ref
-name,,,manual}’ *note cross ref name: (). ‘@ref{,cross ref
-name,title,file name}’ *note cross ref name: (file name). ‘@ref{,cross
-ref name,title,,manual}’ *note cross ref name: (). ‘@ref{,cross ref
-name,title, file name, manual}’ *note cross ref name: (file name).
-‘@ref{,,title,file name}’ *note title: (file name).
-‘@ref{,,title,,manual}’ *note title: (). ‘@ref{,,title, file name,
-manual}’ *note title: (file name). ‘@ref{,,,file name,manual}’ *note
-(file name)::
+name,,file name}’ *note cross ref name: (file name)Top. ‘@ref{,cross ref
+name,,,manual}’ *note cross ref name: ()Top. ‘@ref{,cross ref
+name,title,file name}’ *note cross ref name: (file name)Top.
+‘@ref{,cross ref name,title,,manual}’ *note cross ref name: ()Top.
+‘@ref{,cross ref name,title, file name, manual}’ *note cross ref name:
+(file name)Top. ‘@ref{,,title,file name}’ *note title: (file name)Top.
+‘@ref{,,title,,manual}’ *note title: ()Top. ‘@ref{,,title, file name,
+manual}’ *note title: (file name)Top. ‘@ref{,,,file name,manual}’ *note
+(file name)Top::
‘@inforef{,cross ref name }’ *note cross ref name: . ‘@inforef{,,file
-name}’ *note (file name):: ‘@inforef{,cross ref name, file name}’ *note
-cross ref name: (file name). ‘@inforef{}’ *note ::
+name}’ *note (file name)Top:: ‘@inforef{,cross ref name, file name}’
+*note cross ref name: (file name)Top. ‘@inforef{}’ *note ::
In example.
@@ -2968,8 +2968,8 @@ aaa"