texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/convert/convert_html.c (convert_s


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/convert/convert_html.c (convert_sp_command) (commands_internal_conversion_table): implement convert_sp_command.
Date: Sun, 31 Dec 2023 04:41:56 -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 65bf697de8 * tp/Texinfo/XS/convert/convert_html.c (convert_sp_command) 
(commands_internal_conversion_table): implement convert_sp_command.
65bf697de8 is described below

commit 65bf697de8f7332b68433fdc5eb1df7ff055d9c7
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Dec 31 10:41:55 2023 +0100

    * tp/Texinfo/XS/convert/convert_html.c (convert_sp_command)
    (commands_internal_conversion_table): implement convert_sp_command.
---
 ChangeLog                            |  5 +++++
 tp/Texinfo/XS/convert/convert_html.c | 31 +++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index edafe5cf15..31fc35ccca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-12-31  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/convert/convert_html.c (convert_sp_command)
+       (commands_internal_conversion_table): implement convert_sp_command.
+
 2023-12-31  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/convert_html.c (convert_command_simple_block)
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index c658a28361..dae6d20f41 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -10200,6 +10200,36 @@ convert_command_simple_block (CONVERTER *self, const 
enum command_id cmd,
   destroy_strings_list (classes);
 }
 
+void
+convert_sp_command (CONVERTER *self, const enum command_id cmd,
+                    const ELEMENT *element,
+                    const HTML_ARGS_FORMATTED *args_formatted,
+                    const char *content, TEXT *result)
+{
+  ELEMENT *misc_args = lookup_extra_element (element, "misc_args");
+  if (misc_args && misc_args->contents.number > 0)
+    {
+      int i;
+      ELEMENT *element_with_number = misc_args->contents.list[0];
+      unsigned int sp_nr = strtoul (element_with_number->text.text, NULL, 10);
+
+      if (html_in_preformatted_context (self) || html_in_string (self))
+        {
+          for (i= 0; i < sp_nr; i++)
+            text_append_n (result, "\n", 1);
+        }
+      else
+        {
+          for (i= 0; i < sp_nr; i++)
+            {
+              text_append_n (result, self->line_break_element.string,
+                                     self->line_break_element.len);
+              text_append_n (result, "\n", 1);
+            }
+        }
+    }
+}
+
 void
 convert_xref_commands (CONVERTER *self, const enum command_id cmd,
                     const ELEMENT *element,
@@ -11059,6 +11089,7 @@ static COMMAND_INTERNAL_CONVERSION 
commands_internal_conversion_table[] = {
   {CM_group, &convert_command_simple_block},
 
   {CM_verbatiminclude, &convert_verbatiminclude_command},
+  {CM_sp, &convert_sp_command},
 
   {CM_contents, &convert_contents_command},
   {CM_shortcontents, &convert_contents_command},



reply via email to

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