texinfo-commits
[Top][All Lists]
Advanced

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

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


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/TextContent.pm (_convert): add end of line for all the 'line_arg', excpet when on a def_line as they already have an end of line in that case.
Date: Sat, 01 Jan 2022 13:59:31 -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 9c20a466fa * tp/Texinfo/Convert/TextContent.pm (_convert): add end of 
line for all the 'line_arg', excpet when on a def_line as they already have an 
end of line in that case.
9c20a466fa is described below

commit 9c20a466fa6747feff040ffe8ab64cc3c4a2cb03
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jan 1 19:54:41 2022 +0100

    * tp/Texinfo/Convert/TextContent.pm (_convert): add end of line
    for all the 'line_arg', excpet when on a def_line as they already
    have an end of line in that case.
---
 ChangeLog                                          |  6 ++
 tp/Texinfo/Convert/TextContent.pm                  | 15 +++--
 .../res_parser/formatting_textcontent/formatting   | 72 ++++++++++++++++++----
 3 files changed, 76 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fdd776f749..9ccdb3df84 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,12 @@
        * tp/Texinfo/XS/parsetexi/command_data.txt:
        Put page size commands together.
 
+2022-01-01  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/TextContent.pm (_convert): add end of line
+       for all the 'line_arg', excpet when on a def_line as they already
+       have an end of line in that case.
+
 2022-01-01  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Common.pm (rearrange_tree_beginning),
diff --git a/tp/Texinfo/Convert/TextContent.pm 
b/tp/Texinfo/Convert/TextContent.pm
index 73e0f2bd16..c5735a739b 100644
--- a/tp/Texinfo/Convert/TextContent.pm
+++ b/tp/Texinfo/Convert/TextContent.pm
@@ -68,7 +68,7 @@ sub converter_initialize($)
   
   %{$self->{'formatting_misc_commands'}}
     = %Texinfo::Convert::Text::formatting_misc_commands;
-
+      #%Texinfo::Common::formatted_misc_commands;
   if ($self->get_conf('TEXTCONTENT_COMMENT')) {
     $self->{'formatting_misc_commands'}->{'c'} = 1;
     $self->{'formatting_misc_commands'}->{'comment'} = 1;
@@ -144,7 +144,7 @@ sub _convert($$)
            or !$Texinfo::Common::block_item_commands{$element->{'cmdname'}})) {
     my $args;
     if ($element->{'cmdname'}
-      and $Texinfo::Common::inline_format_commands{$element->{'cmdname'}}) {
+        and $Texinfo::Common::inline_format_commands{$element->{'cmdname'}}) {
       my @args = @{$element->{'args'}};
       shift @args;
       $args = \@args;
@@ -154,10 +154,6 @@ sub _convert($$)
     foreach my $arg (@{$args}) {
       $result .= _convert($self, $arg);
     }
-    if ($element->{'parent'}->{'type'}
-        and $element->{'parent'}->{'type'} eq 'table_term') {
-      $result .= "\n";
-    }
   }
   if ($element->{'contents'}) {
     foreach my $content (@{$element->{'contents'}}) {
@@ -170,6 +166,13 @@ sub _convert($$)
               ($element->{'parent'}->{'type'} ne 'block_line_arg'
                and $element->{'parent'}->{'type'} ne 'line_arg')));
 
+  if ($element->{'type'} and $element->{'type'} eq 'line_arg'
+      # in that case there is already a 'spaces_at_end'
+      and not ($element->{'parent'}->{'type'}
+               and $element->{'parent'}->{'type'} eq 'def_line')) {
+    $result .= "\n";
+  }
+
   return $result;
 }
 
diff --git a/tp/tests/layout/res_parser/formatting_textcontent/formatting 
b/tp/tests/layout/res_parser/formatting_textcontent/formatting
index 756a79f4b0..08c9985578 100644
--- a/tp/tests/layout/res_parser/formatting_textcontent/formatting
+++ b/tp/tests/layout/res_parser/formatting_textcontent/formatting
@@ -211,7 +211,8 @@ a@sup{h}@sub{l} ahl
 
 @sp 2
 
-2@page
+2
+@page
 
 
 need 1002
@@ -619,10 +620,12 @@ f--lushright
 more text
 
 ce--ntered line
+
 r--raggedright
 more text
 
 simplest.texi
+
 in verbatim ''
 
 
@@ -631,11 +634,16 @@ in verbatim ''
 
 
 majorheading
+
 chapheading
+
 heading
+
 subheading
+
 subsubheading
 
+
 @acronym{--a,an accronym @comma{} @enddots{}} --aan accronym , ...
 @abbr{@'E--. @comma{}A., @'Etude--@comma{} @b{Autonome} } E'--. ,A.E'tude--, 
Autonome
 @abbr{@'E--. @comma{}A.} E'--. ,A.
@@ -683,6 +691,7 @@ Invalid use of @':
 @image{,,,3--xt} 3--xt
 
 
+
 e--mph item
 
 e--mph item
@@ -952,7 +961,8 @@ a@sup{h}@sub{l} ahl
 
 @sp 2
 
-2@page
+2
+@page
 
 
 need 1002
@@ -1360,10 +1370,12 @@ f--lushright
 more text
 
 ce--ntered line
+
 r--raggedright
 more text
 
 simplest.texi
+
 in verbatim ''
 
 
@@ -1372,11 +1384,16 @@ in verbatim ''
 
 
 majorheading
+
 chapheading
+
 heading
+
 subheading
+
 subsubheading
 
+
 @acronym{--a,an accronym @comma{} @enddots{}} --aan accronym , ...
 @abbr{@'E--. @comma{}A., @'Etude--@comma{} @b{Autonome} } E'--. ,A.E'tude--, 
Autonome
 @abbr{@'E--. @comma{}A.} E'--. ,A.
@@ -1424,6 +1441,7 @@ Invalid use of @':
 @image{,,,3--xt} 3--xt
 
 
+
 e--mph item
 
 e--mph item
@@ -1489,7 +1507,9 @@ truc after a deff item
 
 Insercopying in titlepage
 
-TopTop section
+Top
+Top section
+
 * chapter::               chapter
 
 Menu comment
@@ -1497,7 +1517,9 @@ Menu comment
 * description:chapter2.   Chapter 2
 
 
-chapterchapter
+chapter
+chapter
+
 First para
 
 qsddsqkdsqkkmljsqjsqodmmdsqdsmqj dqs sdq sqd sdq dsq sdq sqd sqd sdq sdq 
@@ -1715,7 +1737,8 @@ a@sup{h}@sub{l} ahl
 
 @sp 2
 
-2@page
+2
+@page
 
 
 need 1002
@@ -2123,10 +2146,12 @@ f--lushright
 more text
 
 ce--ntered line
+
 r--raggedright
 more text
 
 simplest.texi
+
 in verbatim ''
 
 
@@ -2135,11 +2160,16 @@ in verbatim ''
 
 
 majorheading
+
 chapheading
+
 heading
+
 subheading
+
 subsubheading
 
+
 @acronym{--a,an accronym @comma{} @enddots{}} --aan accronym , ...
 @abbr{@'E--. @comma{}A., @'Etude--@comma{} @b{Autonome} } E'--. ,A.E'tude--, 
Autonome
 @abbr{@'E--. @comma{}A.} E'--. ,A.
@@ -2187,6 +2217,7 @@ Invalid use of @':
 @image{,,,3--xt} 3--xt
 
 
+
 e--mph item
 
 e--mph item
@@ -2456,7 +2487,8 @@ a@sup{h}@sub{l} ahl
 
 @sp 2
 
-2@page
+2
+@page
 
 
 need 1002
@@ -2864,10 +2896,12 @@ f--lushright
 more text
 
 ce--ntered line
+
 r--raggedright
 more text
 
 simplest.texi
+
 in verbatim ''
 
 
@@ -2876,11 +2910,16 @@ in verbatim ''
 
 
 majorheading
+
 chapheading
+
 heading
+
 subheading
+
 subsubheading
 
+
 @acronym{--a,an accronym @comma{} @enddots{}} --aan accronym , ...
 @abbr{@'E--. @comma{}A., @'Etude--@comma{} @b{Autonome} } E'--. ,A.E'tude--, 
Autonome
 @abbr{@'E--. @comma{}A.} E'--. ,A.
@@ -2928,6 +2967,7 @@ Invalid use of @':
 @image{,,,3--xt} 3--xt
 
 
+
 e--mph item
 
 e--mph item
@@ -3039,7 +3079,9 @@ Menu comment
 
 
 
-s--ect,ionA section
+s--ect,ion
+A section
+
 * subsection:: 
 
 In detailmenu
@@ -3047,12 +3089,20 @@ In detailmenu
 * subsubsection ``simple-double--::
 * subsubsection three---four----''::
 
-subsectionsubsection
+subsection
+subsection
+
 * subsubsection ``simple-double--::
 * subsubsection three---four----''::
 
 anchor
-subsubsection ``simple-double--subsubsection ``simple-double--
-subsubsection three---four----''three---four----''
-chapter2chapter 2
+subsubsection ``simple-double--
+subsubsection ``simple-double--
+
+subsubsection three---four----''
+three---four----''
+
+chapter2
+chapter 2
+
 



reply via email to

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