texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert):


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): correctly use _leading_spaces_arg return in case there is no space after @end command line and something else on the line.
Date: Sun, 27 Nov 2022 12:47:11 -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 4b1105f5e3 * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): correctly 
use _leading_spaces_arg return in case there is no space after @end command 
line and something else on the line.
4b1105f5e3 is described below

commit 4b1105f5e33c3d693932901dba638fc51f39f7b5
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 27 18:47:00 2022 +0100

    * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): correctly use
    _leading_spaces_arg return in case there is no space after @end
    command line and something else on the line.
---
 ChangeLog                           | 6 ++++++
 tp/Texinfo/Convert/TexinfoMarkup.pm | 9 +++++----
 tp/t/02coverage.t                   | 6 ++++++
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cfdb958b4d..47c4534895 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-11-27  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): correctly use
+       _leading_spaces_arg return in case there is no space after @end
+       command line and something else on the line.
+
 2022-11-27  Patrice Dumas  <pertusus@free.fr>
 
        * tp/t/test_utils.pl (output_texi_file): encode to UTF-8 the resulting
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index 91af563621..a362af5b31 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -1224,13 +1224,14 @@ sub _convert($$;$)
             and $element->{'contents'}->[-1]->{'cmdname'} eq 'end') {
           $end_command = $element->{'contents'}->[-1];
         }
-        my $end_command_space = _leading_spaces_arg($end_command);
-        if (scalar(@$end_command_space)) {
-          $end_command_space->[0] = 'endspaces';
+        my @end_command_spaces;
+        push @end_command_spaces, _leading_spaces_arg($end_command);
+        if (scalar(@end_command_spaces)) {
+          $end_command_spaces[0]->[0] = 'endspaces';
         }
         $result .= $self->txi_markup_open_element($element->{'cmdname'},
                                    [@$attribute, _leading_spaces_arg($element),
-                                    $end_command_space])
+                                    @end_command_spaces])
                    .${prepended_elements};
         if ($element->{'args'}) {
           my $variadic_element = undef;
diff --git a/tp/t/02coverage.t b/tp/t/02coverage.t
index c0a305aadf..69f940ca80 100644
--- a/tp/t/02coverage.t
+++ b/tp/t/02coverage.t
@@ -646,6 +646,12 @@ In float with caption.
 @guilsinglright{} @textdegree{} @euro{} @arrow{} @leq{} @geq{}
 @end displaymath
 '],
+# also tests no space after @end cartouche before @bye
+['bye_on_end_command_line',
+'@cartouche
+in cartouche.
+@end cartouche@bye
+'],
 );
 
 my @test_tree = (



reply via email to

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