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): add end lines after the closing markup element when @end is missing.
Date: Wed, 30 Nov 2022 17:18:34 -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 9404791a3c * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): add end 
lines after the closing markup element when @end is missing.
9404791a3c is described below

commit 9404791a3ce65c04f8db313a00ba00dc31a02c20
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Nov 30 23:18:24 2022 +0100

    * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): add end lines
    after the closing markup element when @end is missing.
---
 ChangeLog                                          |  5 +++++
 tp/Texinfo/Convert/TexinfoMarkup.pm                |  3 +++
 tp/t/57invalid_nestings.t                          | 25 +++++++++++----------
 .../section_in_nested_block_commands.pl            | 26 ++++++++++++++++++++++
 tp/t/results/invalid_nestings/table_in_code.pl     | 10 +++++++++
 5 files changed, 57 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1d82b38b79..3c790f8a2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-11-30  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): add end lines
+       after the closing markup element when @end is missing.
+
 2022-11-30  Patrice Dumas  <pertusus@free.fr>
 
        Gather tree information when closing incorrectly nested line command
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index 75ffbd6480..06cf3dab02 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -1590,6 +1590,9 @@ sub _convert($$;$)
         my $end_command = $element->{'contents'}->[-1];
         $result .= _end_line_spaces($self, $end_command);
         $result .= $self->format_comment_or_return_end_line($end_command);
+      } else {
+        # missing @end, add an end of line after the closing markup element.
+        $result .= "\n";
       }
     }
     if ($self->{'context_block_commands'}->{$element->{'cmdname'}}) {
diff --git a/tp/t/57invalid_nestings.t b/tp/t/57invalid_nestings.t
index 7b7db02e9c..c9e38eb70b 100644
--- a/tp/t/57invalid_nestings.t
+++ b/tp/t/57invalid_nestings.t
@@ -322,17 +322,6 @@ in copying
 
 @section section
 '],
-['section_in_nested_block_commands',
-'@table @strong
-@item item
-table line
-
-@quotation
-
-in quotation
-
-@section a section
-'],
 ['section_in_footnote',
 '
 Text@footnote{
@@ -560,10 +549,22 @@ text
 @end table
 }
 '],
+['section_in_nested_block_commands',
+'@table @strong
+@item item
+table line
+
+@quotation
+
+in quotation
+
+@section a section
+'],
 );
 
 foreach my $test (@formatted_cases) {
-  $test->[2]->{'test_formats'} = ['plaintext'];
+  push @{$test->[2]->{'test_formats'}}, 'plaintext';
+  push @{$test->[2]->{'test_formats'}}, 'xml';
 }
 
 run_all('invalid_nestings', [@test_cases, @formatted_cases]);
diff --git a/tp/t/results/invalid_nestings/section_in_nested_block_commands.pl 
b/tp/t/results/invalid_nestings/section_in_nested_block_commands.pl
index 6fde339c0d..b81d28312d 100644
--- a/tp/t/results/invalid_nestings/section_in_nested_block_commands.pl
+++ b/tp/t/results/invalid_nestings/section_in_nested_block_commands.pl
@@ -235,4 +235,30 @@ $result_errors{'section_in_nested_block_commands'} = [
 $result_floats{'section_in_nested_block_commands'} = {};
 
 
+
+$result_converted{'plaintext'}->{'section_in_nested_block_commands'} = '*item*
+     table line
+
+          in quotation
+
+1 a section
+===========
+
+';
+
+
+$result_converted{'xml'}->{'section_in_nested_block_commands'} = '<table 
commandarg="strong" spaces=" ">
+<tableentry><tableterm><item spaces=" "><itemformat 
command="strong">item</itemformat></item>
+</tableterm><tableitem><para>table line
+</para>
+<quotation>
+
+<para>in quotation
+</para>
+</quotation>
+</tableitem></tableentry></table>
+<section spaces=" "><sectiontitle>a section</sectiontitle>
+</section>
+';
+
 1;
diff --git a/tp/t/results/invalid_nestings/table_in_code.pl 
b/tp/t/results/invalid_nestings/table_in_code.pl
index 0730abd655..b13d4cc054 100644
--- a/tp/t/results/invalid_nestings/table_in_code.pl
+++ b/tp/t/results/invalid_nestings/table_in_code.pl
@@ -220,4 +220,14 @@ _line_
 
 ';
 
+
+$result_converted{'xml'}->{'table_in_code'} = '<para><code>
+in code
+</code></para><table commandarg="emph" spaces=" " endspaces=" ">
+<tableentry><tableterm><item spaces=" "><itemformat 
command="emph">line</itemformat></item>
+</tableterm><tableitem><para>text
+</para></tableitem></tableentry></table>
+
+';
+
 1;



reply via email to

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