texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_open_brace),


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_open_brace), tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): right in a rawpreformatted, use merge_text to merge an opening brace to the preceding text, if any.
Date: Sat, 11 Mar 2023 05:01:22 -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 23ad548c12 * tp/Texinfo/ParserNonXS.pm (_handle_open_brace), 
tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): right in a 
rawpreformatted, use merge_text to merge an opening brace to the preceding 
text, if any.
23ad548c12 is described below

commit 23ad548c12adc4d3558a5d0b1651d7c95005c23b
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Mar 11 11:01:12 2023 +0100

    * tp/Texinfo/ParserNonXS.pm (_handle_open_brace),
    tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): right in a
    rawpreformatted, use merge_text to merge an opening brace to the
    preceding text, if any.
---
 ChangeLog                                                 |  7 +++++++
 tp/Texinfo/ParserNonXS.pm                                 |  5 +----
 tp/Texinfo/XS/parsetexi/separator.c                       |  5 +----
 tp/t/results/converters_tests/raw_block_commands.pl       | 15 +++------------
 .../converters_tests/raw_block_commands_expand_tex.pl     | 15 +++------------
 tp/t/results/raw/braces_in_tex.pl                         | 10 ++--------
 tp/t/results/raw/raw_in_example.pl                        |  5 +----
 tp/t/results/raw/tex_not_closed.pl                        |  5 +----
 8 files changed, 19 insertions(+), 48 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a714d8120e..658ffa4540 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-03-11  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_handle_open_brace),
+       tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): right in a
+       rawpreformatted, use merge_text to merge an opening brace to the
+       preceding text, if any.
+
 2023-03-11  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/DocBook.pm (_convert), tp/Texinfo/Convert/HTML.pm
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 35bd8420f1..4c1394f57b 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -5697,10 +5697,7 @@ sub _handle_open_brace($$$$)
   } elsif ($current->{'type'}
            and $current->{'type'} eq 'rawpreformatted') {
     # this can happen in an expanded rawpreformatted
-    # FIXME use _merge_text?
-    _abort_empty_line($self, $current);
-    push @{$current->{'contents'}}, {'text' => '{',
-                                     'parent' => $current };
+    $current = _merge_text($self, $current, '{');
     print STDERR "LONE OPEN BRACE in rawpreformatted\n"
        if ($self->{'DEBUG'});
   # matching braces accepted in a rawpreformatted, inline raw or
diff --git a/tp/Texinfo/XS/parsetexi/separator.c 
b/tp/Texinfo/XS/parsetexi/separator.c
index 83022eea23..6f5d4bc7ee 100644
--- a/tp/Texinfo/XS/parsetexi/separator.c
+++ b/tp/Texinfo/XS/parsetexi/separator.c
@@ -187,10 +187,7 @@ handle_open_brace (ELEMENT *current, char **line_inout)
     }
   else if (current->type == ET_rawpreformatted)
     {
-      ELEMENT *e = new_element (ET_NONE);
-      abort_empty_line (&current, NULL);
-      text_append (&e->text, "{");
-      add_to_element_contents (current, e);
+      current = merge_text (current, "{", 0);
     }
   /* matching braces accepted in a rawpreformatted, inline raw or
      math.  Note that for rawpreformatted, it can only happen
diff --git a/tp/t/results/converters_tests/raw_block_commands.pl 
b/tp/t/results/converters_tests/raw_block_commands.pl
index 98f7d9073a..b37ee43f52 100644
--- a/tp/t/results/converters_tests/raw_block_commands.pl
+++ b/tp/t/results/converters_tests/raw_block_commands.pl
@@ -241,10 +241,7 @@ $result_trees{'raw_block_commands'} = {
             {
               'contents' => [
                 {
-                  'text' => '$\\underline'
-                },
-                {
-                  'text' => '{a < b '
+                  'text' => '$\\underline{a < b '
                 },
                 {
                   'args' => [
@@ -345,10 +342,7 @@ $result_trees{'raw_block_commands'} = {
             {
               'contents' => [
                 {
-                  'text' => '$\\frac'
-                },
-                {
-                  'text' => '{a < b '
+                  'text' => '$\\frac{a < b '
                 },
                 {
                   'args' => [
@@ -382,10 +376,7 @@ $result_trees{'raw_block_commands'} = {
                   }
                 },
                 {
-                  'text' => '}'
-                },
-                {
-                  'text' => '{b'
+                  'text' => '}{b'
                 },
                 {
                   'text' => '}$ ``
diff --git a/tp/t/results/converters_tests/raw_block_commands_expand_tex.pl 
b/tp/t/results/converters_tests/raw_block_commands_expand_tex.pl
index 3591a55c87..4f8e97f4fc 100644
--- a/tp/t/results/converters_tests/raw_block_commands_expand_tex.pl
+++ b/tp/t/results/converters_tests/raw_block_commands_expand_tex.pl
@@ -241,10 +241,7 @@ $result_trees{'raw_block_commands_expand_tex'} = {
             {
               'contents' => [
                 {
-                  'text' => '$\\underline'
-                },
-                {
-                  'text' => '{a < b '
+                  'text' => '$\\underline{a < b '
                 },
                 {
                   'args' => [
@@ -345,10 +342,7 @@ $result_trees{'raw_block_commands_expand_tex'} = {
             {
               'contents' => [
                 {
-                  'text' => '$\\frac'
-                },
-                {
-                  'text' => '{a < b '
+                  'text' => '$\\frac{a < b '
                 },
                 {
                   'args' => [
@@ -382,10 +376,7 @@ $result_trees{'raw_block_commands_expand_tex'} = {
                   }
                 },
                 {
-                  'text' => '}'
-                },
-                {
-                  'text' => '{b'
+                  'text' => '}{b'
                 },
                 {
                   'text' => '}$ ``
diff --git a/tp/t/results/raw/braces_in_tex.pl 
b/tp/t/results/raw/braces_in_tex.pl
index 0d4b4c8656..3fba9cb468 100644
--- a/tp/t/results/raw/braces_in_tex.pl
+++ b/tp/t/results/raw/braces_in_tex.pl
@@ -35,10 +35,7 @@ $result_trees{'braces_in_tex'} = {
 '
                 },
                 {
-                  'text' => '\\chi^2 = \\sum_'
-                },
-                {
-                  'text' => '{i=1'
+                  'text' => '\\chi^2 = \\sum_{i=1'
                 },
                 {
                   'text' => '}^N
@@ -145,10 +142,7 @@ $result_trees{'braces_in_tex'} = {
 '
                         },
                         {
-                          'text' => '\\chi^2 = \\sum_'
-                        },
-                        {
-                          'text' => '{i=1'
+                          'text' => '\\chi^2 = \\sum_{i=1'
                         },
                         {
                           'text' => '}^N
diff --git a/tp/t/results/raw/raw_in_example.pl 
b/tp/t/results/raw/raw_in_example.pl
index e3b6368d54..cbbdd0b8c1 100644
--- a/tp/t/results/raw/raw_in_example.pl
+++ b/tp/t/results/raw/raw_in_example.pl
@@ -258,10 +258,7 @@ $result_trees{'raw_in_example'} = {
 '
                         },
                         {
-                          'text' => '\\chi^2 = \\sum_'
-                        },
-                        {
-                          'text' => '{i=1'
+                          'text' => '\\chi^2 = \\sum_{i=1'
                         },
                         {
                           'text' => '}^N
diff --git a/tp/t/results/raw/tex_not_closed.pl 
b/tp/t/results/raw/tex_not_closed.pl
index 11136063ae..9e07367ea2 100644
--- a/tp/t/results/raw/tex_not_closed.pl
+++ b/tp/t/results/raw/tex_not_closed.pl
@@ -31,10 +31,7 @@ $result_trees{'tex_not_closed'} = {
                   'type' => 'empty_line'
                 },
                 {
-                  'text' => 'This is some \\LaTeX'
-                },
-                {
-                  'text' => '{'
+                  'text' => 'This is some \\LaTeX{'
                 },
                 {
                   'text' => '}



reply via email to

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