texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Fri, 8 Dec 2023 11:07:46 -0500 (EST)

branch: master
commit 288c9a9d6e37b355123ab8b7653603dc90ce5f16
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Dec 8 17:05:26 2023 +0100

    * tp/ext/highlight_syntax.pm: do not call
    get_pending_formatted_inline_content at example opening if the
    code calling get_associated_formatted_inline_content will not be
    called for example conversion, to have a correct pairing of calls by
    the preformatted element eventually formatted.
---
 ChangeLog                  |  8 ++++++++
 tp/ext/highlight_syntax.pm | 22 ++++++++++++++++++----
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fdc08f9ff4..ecc0166f0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-12-08  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/ext/highlight_syntax.pm: do not call
+       get_pending_formatted_inline_content at example opening if the
+       code calling get_associated_formatted_inline_content will not be
+       called for example conversion, to have a correct pairing of calls by
+       the preformatted element eventually formatted.
+
 2023-12-08  Patrice Dumas  <pertusus@free.fr>
 
        Pass XS converter errors to texi2any
diff --git a/tp/ext/highlight_syntax.pm b/tp/ext/highlight_syntax.pm
index d5204a1eda..7c381414bc 100644
--- a/tp/ext/highlight_syntax.pm
+++ b/tp/ext/highlight_syntax.pm
@@ -569,11 +569,25 @@ sub highlight_open_inline_container_type($$$)
       return '';
     }
   }
-  my $pending_formatted = $self->get_pending_formatted_inline_content();
+  if (exists ($commands{$cmdname})
+      and exists ($commands{$cmdname}->{'results'})) {
+    my ($language, $converted_language)
+                = _get_language($self, $cmdname, $command);
+    if (exists ($commands{$cmdname}->{'results'}->{$command})
+        and defined($commands{$cmdname}->{'results'}->{$command})) {
+
+      # only replace the example and inside preformatted if the code leading
+      # to get_associated_formatted_inline_content being called in
+      # example highlighted text formatting will be called
+      if (defined($language)) {
+        my $pending_formatted = $self->get_pending_formatted_inline_content();
 
-  if (defined($pending_formatted)) {
-    $self->associate_pending_formatted_inline_content($command,
-                                                      $pending_formatted);
+        if (defined($pending_formatted)) {
+            $self->associate_pending_formatted_inline_content($command,
+                                                          $pending_formatted);
+        }
+      }
+    }
   }
   return '';
 }



reply via email to

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