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_a


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/convert/convert_html.c (convert_author_command), (commands_internal_conversion_table): implement convert_author_command.
Date: Sun, 31 Dec 2023 05:32:16 -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 225e640812 * tp/Texinfo/XS/convert/convert_html.c 
(convert_author_command), (commands_internal_conversion_table): implement 
convert_author_command.
225e640812 is described below

commit 225e640812c35e60fe5bfec3a48f94f454d90cb3
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Dec 31 11:32:16 2023 +0100

    * tp/Texinfo/XS/convert/convert_html.c (convert_author_command),
    (commands_internal_conversion_table): implement
    convert_author_command.
---
 ChangeLog                            |  6 +++++
 tp/Texinfo/XS/convert/convert_html.c | 47 ++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 334251424d..ed03d14ae8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-12-31  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/convert/convert_html.c (convert_author_command),
+       (commands_internal_conversion_table): implement
+       convert_author_command.
+
 2023-12-31  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/convert_html.c (convert_center_command)
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index eab9caf970..60839eb636 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -10326,6 +10326,52 @@ convert_center_command (CONVERTER *self, const enum 
command_id cmd,
   destroy_strings_list (classes);
 }
 
+void
+convert_author_command (CONVERTER *self, const enum command_id cmd,
+                    const ELEMENT *element,
+                    const HTML_ARGS_FORMATTED *args_formatted,
+                    const char *content, TEXT *result)
+{
+  char *arg = 0;
+  char *attribute_class;
+  STRING_LIST *classes;
+
+  ELEMENT *titlepage = lookup_extra_element (element, "titlepage");
+
+  if (!titlepage)
+    return;
+
+  if (args_formatted->number > 0
+      && args_formatted->args[0].formatted[AFT_type_normal]
+      && strlen (args_formatted->args[0].formatted[AFT_type_normal]))
+    arg = args_formatted->args[0].formatted[AFT_type_normal];
+  else
+    return;
+
+  if (html_in_string (self))
+    {
+      text_append (result, arg);
+      text_append_n (result, "\n", 1);
+      return;
+    }
+
+  classes = (STRING_LIST *) malloc (sizeof (STRING_LIST));
+  memset (classes, 0, sizeof (STRING_LIST));
+  add_string (builtin_command_name (cmd), classes);
+
+  attribute_class = html_attribute_class (self, "strong", classes);
+  text_append (result, attribute_class);
+  text_append_n (result, ">", 1);
+  text_append (result, arg);
+  text_append_n (result, "</strong>", 9);
+  text_append_n (result, self->line_break_element.string,
+                         self->line_break_element.len);
+  text_append_n (result, "\n", 1);
+
+  free (attribute_class);
+  destroy_strings_list (classes);
+}
+
 void
 convert_xref_commands (CONVERTER *self, const enum command_id cmd,
                     const ELEMENT *element,
@@ -11188,6 +11234,7 @@ static COMMAND_INTERNAL_CONVERSION 
commands_internal_conversion_table[] = {
   {CM_sp, &convert_sp_command},
   {CM_exdent, &convert_exdent_command},
   {CM_center, &convert_center_command},
+  {CM_author, &convert_author_command},
 
   {CM_contents, &convert_contents_command},
   {CM_shortcontents, &convert_contents_command},



reply via email to

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