[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/convert/convert_html.c (convert_e
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/convert/convert_html.c (convert_exdent_command) (commands_internal_conversion_table): implement convert_exdent_command. |
Date: |
Sun, 31 Dec 2023 04:57:23 -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 4f9a75feae * tp/Texinfo/XS/convert/convert_html.c
(convert_exdent_command) (commands_internal_conversion_table): implement
convert_exdent_command.
4f9a75feae is described below
commit 4f9a75feaeae93d6ff95d557f26308c0143d7563
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Dec 31 10:57:23 2023 +0100
* tp/Texinfo/XS/convert/convert_html.c (convert_exdent_command)
(commands_internal_conversion_table): implement
convert_exdent_command.
---
ChangeLog | 6 ++++
tp/Texinfo/XS/convert/convert_html.c | 58 ++++++++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 31fc35ccca..62ef1644e6 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_exdent_command)
+ (commands_internal_conversion_table): implement
+ convert_exdent_command.
+
2023-12-31 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/convert_html.c (convert_sp_command)
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index dae6d20f41..5242c544aa 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -10230,6 +10230,63 @@ convert_sp_command (CONVERTER *self, const enum
command_id cmd,
}
}
+void
+convert_exdent_command (CONVERTER *self, const enum command_id cmd,
+ const ELEMENT *element,
+ const HTML_ARGS_FORMATTED *args_formatted,
+ const char *content, TEXT *result)
+{
+ char *pending_formatted = html_get_pending_formatted_inline_content (self);
+ char *arg = 0;
+ char *attribute_class;
+ STRING_LIST *classes;
+
+ 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];
+
+ if (html_in_string (self))
+ {
+ if (pending_formatted)
+ {
+ text_append (result, pending_formatted);
+ free (pending_formatted);
+ }
+ if (arg)
+ 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);
+
+ if (html_in_preformatted_context (self))
+ attribute_class = html_attribute_class (self, "pre", classes);
+ else
+ attribute_class = html_attribute_class (self, "p", classes);
+
+ text_append (result, attribute_class);
+ text_append_n (result, ">", 1);
+ if (pending_formatted)
+ {
+ text_append (result, pending_formatted);
+ free (pending_formatted);
+ }
+ if (arg)
+ text_append (result, arg);
+ text_append_n (result, "\n", 1);
+ if (html_in_preformatted_context (self))
+ text_append_n (result, "</pre>", 6);
+ else
+ text_append_n (result, "</p>", 4);
+
+ free (attribute_class);
+ destroy_strings_list (classes);
+}
+
void
convert_xref_commands (CONVERTER *self, const enum command_id cmd,
const ELEMENT *element,
@@ -11090,6 +11147,7 @@ static COMMAND_INTERNAL_CONVERSION
commands_internal_conversion_table[] = {
{CM_verbatiminclude, &convert_verbatiminclude_command},
{CM_sp, &convert_sp_command},
+ {CM_exdent, &convert_exdent_command},
{CM_contents, &convert_contents_command},
{CM_shortcontents, &convert_contents_command},
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/convert/convert_html.c (convert_exdent_command) (commands_internal_conversion_table): implement convert_exdent_command.,
Patrice Dumas <=