texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Sun, 11 Dec 2022 12:44:18 -0500 (EST)

branch: master
commit 4c5923da0883d2040179af379b0e118dd9ed7136
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Dec 11 18:43:51 2022 +0100

    * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): add a newline
    at the end of block command lines if there is none (case of another
    command interrupting the block command line).
---
 ChangeLog                                          |  6 ++++++
 tp/Texinfo/Convert/TexinfoMarkup.pm                |  3 +++
 .../invalid_nestings/section_on_enumerate_line.pl  |  6 ++++--
 .../invalid_nestings/section_on_float_line.pl      |  3 ++-
 .../invalid_nestings/section_on_itemize_line.pl    | 12 +++++++----
 .../example_invalid_at_commands_arguments.pl       |  3 ++-
 .../quotation_beginning_and_end_on_line.pl         |  3 ++-
 .../space_at_commands_end_quotation_line.pl        |  3 ++-
 .../res_parser/formatting_xml/formatting.xml       | 24 ++++++++++++++--------
 9 files changed, 45 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8049239986..c24b887f69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,12 @@
        Separate out code for 'unfilled' to make the rest of the code
        easier to understand.
 
+2022-12-11  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): add a newline
+       at the end of block command lines if there is none (case of another
+       command interrupting the block command line).
+
 2022-12-11  Patrice Dumas  <pertusus@free.fr>
 
        * tp/maintain/check_back_xml_forth_texi_t.sh: handle 3 digits in
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index 23770e9b48..3bfdae6694 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -1372,6 +1372,9 @@ sub _convert($$;$)
                   # last argument
                   ($arg, $end_space, $end_line)
                     = $self->_convert_argument_and_end_line($element);
+                  # happens for @-commands interrupted by other commands
+                  # incorrectly present on the line
+                  $end_line = "\n" if ($end_line eq '');
                 } else {
                   $arg = $self->_convert($arg_element);
                   push @$spaces, _trailing_spaces_arg($arg_element);
diff --git a/tp/t/results/invalid_nestings/section_on_enumerate_line.pl 
b/tp/t/results/invalid_nestings/section_on_enumerate_line.pl
index 94bad9976a..71e7aea33a 100644
--- a/tp/t/results/invalid_nestings/section_on_enumerate_line.pl
+++ b/tp/t/results/invalid_nestings/section_on_enumerate_line.pl
@@ -252,10 +252,12 @@ 
$result_converted{'plaintext'}->{'section_on_enumerate_line'} = '1 first
 ';
 
 
-$result_converted{'xml'}->{'section_on_enumerate_line'} = '<enumerate 
first="1" spaces=" "><enumeratefirst>something </enumeratefirst></enumerate>
+$result_converted{'xml'}->{'section_on_enumerate_line'} = '<enumerate 
first="1" spaces=" "><enumeratefirst>something </enumeratefirst>
+</enumerate>
 <section spaces=" "><sectiontitle>first</sectiontitle>
 
-<enumerate first="4" spaces=" "><enumeratefirst>4 </enumeratefirst></enumerate>
+<enumerate first="4" spaces=" "><enumeratefirst>4 </enumeratefirst>
+</enumerate>
 </section>
 <section spaces=" "><sectiontitle>second</sectiontitle>
 </section>
diff --git a/tp/t/results/invalid_nestings/section_on_float_line.pl 
b/tp/t/results/invalid_nestings/section_on_float_line.pl
index 601284d79d..0c33c6b680 100644
--- a/tp/t/results/invalid_nestings/section_on_float_line.pl
+++ b/tp/t/results/invalid_nestings/section_on_float_line.pl
@@ -178,7 +178,8 @@ $result_converted{'plaintext'}->{'section_on_float_line'} = 
't 1
 ';
 
 
-$result_converted{'xml'}->{'section_on_float_line'} = '<float name="l" 
type="t" number="1" spaces=" "><floattype>t</floattype><floatname spaces=" ">l 
</floatname></float>
+$result_converted{'xml'}->{'section_on_float_line'} = '<float name="l" 
type="t" number="1" spaces=" "><floattype>t</floattype><floatname spaces=" ">l 
</floatname>
+</float>
 <section spaces=" "><sectiontitle>first</sectiontitle>
 </section>
 ';
diff --git a/tp/t/results/invalid_nestings/section_on_itemize_line.pl 
b/tp/t/results/invalid_nestings/section_on_itemize_line.pl
index bc5b07ef44..e4383bb1cc 100644
--- a/tp/t/results/invalid_nestings/section_on_itemize_line.pl
+++ b/tp/t/results/invalid_nestings/section_on_itemize_line.pl
@@ -482,18 +482,22 @@ 
$result_converted{'plaintext'}->{'section_on_itemize_line'} = '1 first
 ';
 
 
-$result_converted{'xml'}->{'section_on_itemize_line'} = '<itemize 
commandarg="minus" spaces=" "><itemprepend>&minus; </itemprepend></itemize>
+$result_converted{'xml'}->{'section_on_itemize_line'} = '<itemize 
commandarg="minus" spaces=" "><itemprepend>&minus; </itemprepend>
+</itemize>
 <section spaces=" "><sectiontitle>first</sectiontitle>
 
-<itemize spaces=" "><itemprepend>&minus; aa </itemprepend></itemize>
+<itemize spaces=" "><itemprepend>&minus; aa </itemprepend>
+</itemize>
 </section>
 <section spaces=" "><sectiontitle>second</sectiontitle>
 
-<itemize commandarg="bullet" spaces=" "><itemprepend><formattingcommand 
command="bullet" automatic="on"/></itemprepend></itemize>
+<itemize commandarg="bullet" spaces=" "><itemprepend><formattingcommand 
command="bullet" automatic="on"/></itemprepend>
+</itemize>
 </section>
 <section spaces=" "><sectiontitle>third</sectiontitle>
 
-<itemize spaces=" "><itemprepend><accent 
type="ring"></accent></itemprepend></itemize>
+<itemize spaces=" "><itemprepend><accent type="ring"></accent></itemprepend>
+</itemize>
 </section>
 <section spaces=" "><sectiontitle>fourth</sectiontitle>
 </section>
diff --git a/tp/t/results/preformatted/example_invalid_at_commands_arguments.pl 
b/tp/t/results/preformatted/example_invalid_at_commands_arguments.pl
index 73fdc86998..e818d7e0ee 100644
--- a/tp/t/results/preformatted/example_invalid_at_commands_arguments.pl
+++ b/tp/t/results/preformatted/example_invalid_at_commands_arguments.pl
@@ -276,7 +276,8 @@ 
$result_converted{'docbook'}->{'example_invalid_at_commands_arguments'} = '';
 
 
 $result_converted{'xml'}->{'example_invalid_at_commands_arguments'} = 
'<example spaces=" " endspaces=" "><examplelanguage><ref label="a" 
manual="d"><xrefnodename>a</xrefnodename><xrefinfoname>b</xrefinfoname><xrefprinteddesc>c</xrefprinteddesc><xrefinfofile>d</xrefinfofile></ref>
 fa</examplelanguage><examplearg spaces=" "><anchor name="an-anchor">an 
anchor</anchor> on example line</examplearg><examplearg spaces=" "><center 
spaces=" ">in center</center>
-</examplearg></example>
+</examplearg>
+</example>
 ';
 
 
diff --git a/tp/t/results/quotation/quotation_beginning_and_end_on_line.pl 
b/tp/t/results/quotation/quotation_beginning_and_end_on_line.pl
index 078750e095..c86925d21d 100644
--- a/tp/t/results/quotation/quotation_beginning_and_end_on_line.pl
+++ b/tp/t/results/quotation/quotation_beginning_and_end_on_line.pl
@@ -102,7 +102,8 @@ 
$result_converted{'html_text'}->{'quotation_beginning_and_end_on_line'} = '<bloc
 ';
 
 
-$result_converted{'xml'}->{'quotation_beginning_and_end_on_line'} = 
'<quotation spaces=" " endspaces=" "><quotationtype>in quotation 
</quotationtype></quotation>
+$result_converted{'xml'}->{'quotation_beginning_and_end_on_line'} = 
'<quotation spaces=" " endspaces=" "><quotationtype>in quotation 
</quotationtype>
+</quotation>
 ';
 
 
diff --git a/tp/t/results/quotation/space_at_commands_end_quotation_line.pl 
b/tp/t/results/quotation/space_at_commands_end_quotation_line.pl
index 5b949866c7..8612e88f21 100644
--- a/tp/t/results/quotation/space_at_commands_end_quotation_line.pl
+++ b/tp/t/results/quotation/space_at_commands_end_quotation_line.pl
@@ -228,7 +228,8 @@ 
$result_converted{'html_text'}->{'space_at_commands_end_quotation_line'} = '<blo
 ';
 
 
-$result_converted{'xml'}->{'space_at_commands_end_quotation_line'} = 
'<quotation spaces=" " endspaces=" "><quotationtype>&arobase; at the end of 
line <spacecmd type="nl"/></quotationtype><para>A &arobase; at the end of the 
&arobase;quotation line.
+$result_converted{'xml'}->{'space_at_commands_end_quotation_line'} = 
'<quotation spaces=" " endspaces=" "><quotationtype>&arobase; at the end of 
line <spacecmd type="nl"/></quotationtype>
+<para>A &arobase; at the end of the &arobase;quotation line.
 </para></quotation>
 
 <quotation spaces=" " endspaces=" "><quotationtype>&arobase;<spacecmd 
type="spc"/> at the end of line <spacecmd type="spc"/></quotationtype>
diff --git a/tp/tests/layout/res_parser/formatting_xml/formatting.xml 
b/tp/tests/layout/res_parser/formatting_xml/formatting.xml
index 5ee83c5343..f550b395ec 100644
--- a/tp/tests/layout/res_parser/formatting_xml/formatting.xml
+++ b/tp/tests/layout/res_parser/formatting_xml/formatting.xml
@@ -1578,7 +1578,8 @@ f(x) = {1 \over \sigma \sqrt{2\pi}}e<sup>-{1 \over 
2}\left({x-\mu \over \sigma}\
 <para>The something <accent type="acute" bracketed="off">e</accent> &tex; is 
here.
 </para></quotation>
 
-<quotation spaces=" " endspaces=" "><quotationtype>&arobase; at the end of 
line <spacecmd type="nl"/></quotationtype><para>A &arobase; at the end of the 
&arobase;quotation line.
+<quotation spaces=" " endspaces=" "><quotationtype>&arobase; at the end of 
line <spacecmd type="nl"/></quotationtype>
+<para>A &arobase; at the end of the &arobase;quotation line.
 </para></quotation>
 
 <quotation spaces=" " endspaces=" "><quotationtype>something, other 
thing</quotationtype>
@@ -1741,7 +1742,8 @@ quotation
 <pre xml:space="preserve">The something <accent type="acute" 
bracketed="off">e</accent> &tex; is here.
 </pre></example>
 
-<example spaces=" " endspaces=" "><examplelanguage>&arobase; at the end of 
line <spacecmd type="nl"/></examplelanguage><pre xml:space="preserve">A 
&arobase; at the end of the &arobase;example line.
+<example spaces=" " endspaces=" "><examplelanguage>&arobase; at the end of 
line <spacecmd type="nl"/></examplelanguage>
+<pre xml:space="preserve">A &arobase; at the end of the &arobase;example line.
 </pre></example>
 
 <example spaces=" " endspaces=" 
"><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg>
@@ -2728,7 +2730,8 @@ f(x) = {1 \over \sigma \sqrt{2\pi}}e<sup>-{1 \over 
2}\left({x-\mu \over \sigma}\
 <para>The something <accent type="acute" bracketed="off">e</accent> &tex; is 
here.
 </para></quotation>
 
-<quotation spaces=" " endspaces=" "><quotationtype>&arobase; at the end of 
line <spacecmd type="nl"/></quotationtype><para>A &arobase; at the end of the 
&arobase;quotation line.
+<quotation spaces=" " endspaces=" "><quotationtype>&arobase; at the end of 
line <spacecmd type="nl"/></quotationtype>
+<para>A &arobase; at the end of the &arobase;quotation line.
 </para></quotation>
 
 <quotation spaces=" " endspaces=" "><quotationtype>something, other 
thing</quotationtype>
@@ -2891,7 +2894,8 @@ quotation
 <pre xml:space="preserve">The something <accent type="acute" 
bracketed="off">e</accent> &tex; is here.
 </pre></example>
 
-<example spaces=" " endspaces=" "><examplelanguage>&arobase; at the end of 
line <spacecmd type="nl"/></examplelanguage><pre xml:space="preserve">A 
&arobase; at the end of the &arobase;example line.
+<example spaces=" " endspaces=" "><examplelanguage>&arobase; at the end of 
line <spacecmd type="nl"/></examplelanguage>
+<pre xml:space="preserve">A &arobase; at the end of the &arobase;example line.
 </pre></example>
 
 <example spaces=" " endspaces=" 
"><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg>
@@ -3908,7 +3912,8 @@ f(x) = {1 \over \sigma \sqrt{2\pi}}e<sup>-{1 \over 
2}\left({x-\mu \over \sigma}\
 <para>The something <accent type="acute" bracketed="off">e</accent> &tex; is 
here.
 </para></quotation>
 
-<quotation spaces=" " endspaces=" "><quotationtype>&arobase; at the end of 
line <spacecmd type="nl"/></quotationtype><para>A &arobase; at the end of the 
&arobase;quotation line.
+<quotation spaces=" " endspaces=" "><quotationtype>&arobase; at the end of 
line <spacecmd type="nl"/></quotationtype>
+<para>A &arobase; at the end of the &arobase;quotation line.
 </para></quotation>
 
 <quotation spaces=" " endspaces=" "><quotationtype>something, other 
thing</quotationtype>
@@ -4071,7 +4076,8 @@ quotation
 <pre xml:space="preserve">The something <accent type="acute" 
bracketed="off">e</accent> &tex; is here.
 </pre></example>
 
-<example spaces=" " endspaces=" "><examplelanguage>&arobase; at the end of 
line <spacecmd type="nl"/></examplelanguage><pre xml:space="preserve">A 
&arobase; at the end of the &arobase;example line.
+<example spaces=" " endspaces=" "><examplelanguage>&arobase; at the end of 
line <spacecmd type="nl"/></examplelanguage>
+<pre xml:space="preserve">A &arobase; at the end of the &arobase;example line.
 </pre></example>
 
 <example spaces=" " endspaces=" 
"><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg>
@@ -5053,7 +5059,8 @@ f(x) = {1 \over \sigma \sqrt{2\pi}}e<sup>-{1 \over 
2}\left({x-\mu \over \sigma}\
 <pre xml:space="preserve">The something <accent type="acute" 
bracketed="off">e</accent> &tex; is here.
 </pre></quotation>
 <pre xml:space="preserve">
-</pre><quotation spaces=" " endspaces=" "><quotationtype>&arobase; at the end 
of line <spacecmd type="nl"/></quotationtype><pre xml:space="preserve">A 
&arobase; at the end of the &arobase;quotation line.
+</pre><quotation spaces=" " endspaces=" "><quotationtype>&arobase; at the end 
of line <spacecmd type="nl"/></quotationtype>
+<pre xml:space="preserve">A &arobase; at the end of the &arobase;quotation 
line.
 </pre></quotation>
 <pre xml:space="preserve">
 </pre><quotation spaces=" " endspaces=" "><quotationtype>something, other 
thing</quotationtype>
@@ -5216,7 +5223,8 @@ indent in quotation
 <pre xml:space="preserve">The something <accent type="acute" 
bracketed="off">e</accent> &tex; is here.
 </pre></example>
 <pre xml:space="preserve">
-</pre><example spaces=" " endspaces=" "><examplelanguage>&arobase; at the end 
of line <spacecmd type="nl"/></examplelanguage><pre xml:space="preserve">A 
&arobase; at the end of the &arobase;example line.
+</pre><example spaces=" " endspaces=" "><examplelanguage>&arobase; at the end 
of line <spacecmd type="nl"/></examplelanguage>
+<pre xml:space="preserve">A &arobase; at the end of the &arobase;example line.
 </pre></example>
 <pre xml:space="preserve">
 </pre><example spaces=" " endspaces=" 
"><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg>



reply via email to

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