[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Remove extra space for @nodedescriptionblock
From: |
Gavin D. Smith |
Subject: |
branch master updated: Remove extra space for @nodedescriptionblock |
Date: |
Tue, 01 Aug 2023 16:16:32 -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 1a02255329 Remove extra space for @nodedescriptionblock
1a02255329 is described below
commit 1a0225532919469f3490d0e3e264af4ef93c81ab
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Aug 1 21:16:24 2023 +0100
Remove extra space for @nodedescriptionblock
* tp/Texinfo/Convert/Plaintext.pm (_convert) <@nodedescriptionblock>:
Check if space is needed before adding space with current paragraph
formatter, as the existing check would always be true and the space
would be added, leading @nodedescriptionblock descriptions to be
indented by an extra space compared with @nodedescription descriptions.
---
ChangeLog | 10 ++++++++++
tp/Texinfo/Convert/Plaintext.pm | 8 ++++----
tp/t/results/menu/commands_in_nodedescriptionblock.pl | 4 ++--
tp/t/results/menu/nodedescriptionblock_descriptions.pl | 2 +-
4 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a3f5175778..5cafad66d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-08-01 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Remove extra space for @nodedescriptionblock
+
+ * tp/Texinfo/Convert/Plaintext.pm (_convert) <@nodedescriptionblock>:
+ Check if space is needed before adding space with current paragraph
+ formatter, as the existing check would always be true and the space
+ would be added, leading @nodedescriptionblock descriptions to be
+ indented by an extra space compared with @nodedescription descriptions.
+
2023-08-01 Gavin Smith <gavinsmith0123@gmail.com>
* tp/t/10menu.t (nodedescription_descriptions): Adjust test so
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 09f466cdd6..dedffb2408 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -3503,10 +3503,10 @@ sub _convert($$)
add_pending_word($formatter->{'container'}, 1));
my $formatted_elt;
my $description_para;
+ my $text_count =
Texinfo::Convert::Paragraph::counter($formatter->{'container'});
my $text_element_context = {
- 'max' =>
$self->{'text_element_context'}->[-1]->{'max'},
- 'counter'
- =>
Texinfo::Convert::Paragraph::counter($formatter->{'container'})
+ 'max' => $self->{'text_element_context'}->[-1]->{'max'},
+ 'counter' => $text_count
};
if (defined($self->get_conf('AUTO_MENU_DESCRIPTION_FILLCOLUMN'))) {
@@ -3537,7 +3537,7 @@ sub _convert($$)
push @{$self->{'formatters'}}, $description_para;
$formatted_elt = $description_element->{'args'}->[0];
} else {
- if ($result !~ /\s$/) {
+ if ($text_count >= $description_indent_length) {
$result .= _count_added($self, $formatter->{'container'},
add_text($formatter->{'container'}, ' '));
$result .= _count_added($self,
diff --git a/tp/t/results/menu/commands_in_nodedescriptionblock.pl
b/tp/t/results/menu/commands_in_nodedescriptionblock.pl
index f85b7c906b..c29ebe3284 100644
--- a/tp/t/results/menu/commands_in_nodedescriptionblock.pl
+++ b/tp/t/results/menu/commands_in_nodedescriptionblock.pl
@@ -1358,7 +1358,7 @@
$result_converted{'plaintext'}->{'commands_in_nodedescriptionblock'} = 'test com
* Menu:
-* node1::
+* node1::
*note node2::. Footnote(1). Some text to see where the max
column could
be. in w.
@@ -1385,7 +1385,7 @@
$result_converted{'plaintext'}->{'commands_in_nodedescriptionblock'} = 'test com
* Menu:
-* node1::
+* node1::
*note node2::. Footnote(1). Some text to see where the max
column could
be. in w.
diff --git a/tp/t/results/menu/nodedescriptionblock_descriptions.pl
b/tp/t/results/menu/nodedescriptionblock_descriptions.pl
index 808fb01295..5b300ffd74 100644
--- a/tp/t/results/menu/nodedescriptionblock_descriptions.pl
+++ b/tp/t/results/menu/nodedescriptionblock_descriptions.pl
@@ -1909,7 +1909,7 @@
$result_converted{'plaintext'}->{'nodedescriptionblock_descriptions'} = 'test of
description_slightly long and vv somewhat
ånexpected
* titi:: desc of titi
-* name of other: other. Long description of other
+* name of other: other. Long description of other
Para2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Remove extra space for @nodedescriptionblock,
Gavin D. Smith <=