[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: @link for Info output
From: |
Gavin D. Smith |
Subject: |
branch master updated: @link for Info output |
Date: |
Fri, 05 May 2023 13:18:16 -0400 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new c3749431c7 @link for Info output
c3749431c7 is described below
commit c3749431c71b5e6cc8ba67847900e7a124d5ca8b
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri May 5 18:17:47 2023 +0100
@link for Info output
* tp/Texinfo/command_data.txt: Add @link.
* tp/Texinfo/Convert/Plaintext.pm (_convert): Handle.
---
ChangeLog | 7 +++++++
tp/Texinfo/Convert/Plaintext.pm | 17 +++++++++++++++++
tp/Texinfo/XS/parsetexi/command_ids.h | 1 +
tp/Texinfo/command_data.txt | 1 +
4 files changed, 26 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 21a9e5348b..ba0ce10c6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-05-05 Gavin Smith <gavinsmith0123@gmail.com>
+
+ @link for Info output
+
+ * tp/Texinfo/command_data.txt: Add @link.
+ * tp/Texinfo/Convert/Plaintext.pm (_convert): Handle.
+
2023-04-21 Gavin Smith <gavinsmith0123@gmail.com>
* info/infomap.c (default_vi_like_info_keys): Add BackTab for
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 87f58ddb0e..510646126c 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -2036,6 +2036,23 @@ sub _convert($$)
}
}
return $result;
+ } elsif ($command eq 'link') {
+ # Use arg 2 if present, otherwise use arg 1. Do not produce
+ # functional link in Info/plaintext output.
+ my $text_arg;
+
+ if (defined($element->{'args'}->[1])
+ and defined($element->{'args'}->[1]->{'contents'})) {
+ $text_arg = $element->{'args'}->[1];
+ } elsif (defined($element->{'args'}->[0])
+ and defined($element->{'args'}->[0]->{'contents'})) {
+ $text_arg = $element->{'args'}->[0];
+ }
+ if (defined($text_arg)) {
+ $result = _convert($self, $text_arg);
+ return $result;
+ }
+ return '';
} elsif ($ref_commands{$command}) {
if (scalar(@{$element->{'args'}})) {
my @args;
diff --git a/tp/Texinfo/XS/parsetexi/command_ids.h
b/tp/Texinfo/XS/parsetexi/command_ids.h
index a1792e3aec..a4250f63da 100644
--- a/tp/Texinfo/XS/parsetexi/command_ids.h
+++ b/tp/Texinfo/XS/parsetexi/command_ids.h
@@ -266,6 +266,7 @@ CM_latex,
CM_lbracechar,
CM_leq,
CM_linemacro,
+CM_link,
CM_lisp,
CM_listoffloats,
CM_lowersections,
diff --git a/tp/Texinfo/command_data.txt b/tp/Texinfo/command_data.txt
index c9d4f3d381..4f599619d0 100644
--- a/tp/Texinfo/command_data.txt
+++ b/tp/Texinfo/command_data.txt
@@ -434,6 +434,7 @@ xref brace,ref,contain_basic_inline
BRACE_arguments 5
ref brace,ref,contain_basic_inline BRACE_arguments 5
pxref brace,ref,contain_basic_inline BRACE_arguments 5
image brace,contain_basic_inline,no_paragraph
BRACE_arguments 5
+link brace,contain_basic_inline BRACE_arguments 3
# leading space is ignored in inline brace commands, not trailing space
# inline format command
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: @link for Info output,
Gavin D. Smith <=