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): format @bye line similarly to other skipline @-commands.
Date: Tue, 27 Dec 2022 05:54:01 -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 30f5ae798f * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): format 
@bye line similarly to other skipline @-commands.
30f5ae798f is described below

commit 30f5ae798f368b77d8d7ed715d133fc6433cef7a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Dec 27 11:53:51 2022 +0100

    * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): format @bye line
    similarly to other skipline @-commands.
---
 ChangeLog                                          |  5 +++++
 tp/Texinfo/Convert/TexinfoMarkup.pm                | 25 +++++++++++-----------
 .../misc_commands/comment_space_command_on_line.pl |  4 ++--
 3 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7dadb1ea5f..5626abc61f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-12-27  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): format @bye line
+       similarly to other skipline @-commands.
+
 2022-12-27  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/TexinfoMarkup.pm (%type_elements, _convert),
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index 773ee3d204..bc6dcbc8d9 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -913,6 +913,16 @@ sub _convert($$;$)
                .$self->txi_markup_close_element($cmdname).$end_line;
         }
       } elsif ($type eq 'skipline') {
+        my $attribute = [];
+        if ($element->{'args'} and $element->{'args'}->[0]
+            and defined($element->{'args'}->[0]->{'text'})) {
+          my $line = $element->{'args'}->[0]->{'text'};
+          chomp($line);
+          $attribute = [['line', $line]]
+             if ($line ne '');
+        }
+        my $result = $self->txi_markup_open_element($cmdname, $attribute)
+                 .$self->txi_markup_close_element($cmdname)."\n";
         # the command associated with an element is closed at the end of the
         # element. @bye is withing the element, but we want it to appear after
         # the command closing.  So we delay the output of @bye, and store it.
@@ -921,20 +931,11 @@ sub _convert($$;$)
             and $element->{'structure'}->{'associated_unit'}->{'extra'}
             and defined($element->{'structure'}->{'associated_unit'}
                                                ->{'extra'}->{'unit_command'})) 
{
-          $self->{'pending_bye'} = $self->txi_markup_open_element($cmdname)
-                    .$self->txi_markup_close_element($cmdname)."\n";
+          $self->{'pending_bye'} = $result;
           return '';
+        } else {
+          return $result;
         }
-        my $attribute = [];
-        if ($element->{'args'} and $element->{'args'}->[0]
-            and defined($element->{'args'}->[0]->{'text'})) {
-          my $line = $element->{'args'}->[0]->{'text'};
-          chomp($line);
-          $attribute = [['line', $line]]
-             if ($line ne '');
-        }
-        return $self->txi_markup_open_element($cmdname, $attribute)
-                 .$self->txi_markup_close_element($cmdname)."\n";
       } elsif ($type eq 'special') {
         if ($cmdname eq 'clear' or $cmdname eq 'set') {
           my $attribute = [];
diff --git a/tp/t/results/misc_commands/comment_space_command_on_line.pl 
b/tp/t/results/misc_commands/comment_space_command_on_line.pl
index e9ab82577c..0c05e70848 100644
--- a/tp/t/results/misc_commands/comment_space_command_on_line.pl
+++ b/tp/t/results/misc_commands/comment_space_command_on_line.pl
@@ -1153,7 +1153,7 @@ 
$result_converted{'xml'}->{'comment_space_command_on_line'} = '<settitle spaces=
 <listoffloats type="Text  " spaces=" ">Text <spacecmd 
type="spc"/></listoffloats><!-- c listoffloats -->
 
 </chapter>
-<bye></bye>
+<bye line=" @c bye"></bye>
 ';
 
 
@@ -1183,7 +1183,7 @@ 
$result_converted{'xml'}->{'comment_space_command_on_line'} = '<settitle spaces=
 <listoffloats type="Text  " spaces=" ">Text <spacecmd 
type="spc"/></listoffloats><!-- c listoffloats -->
 
 </chapter>
-<bye></bye>
+<bye line=" @c bye"></bye>
 ';
 
 1;



reply via email to

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