[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_enumerate_command) (commands_internal_conversion_table): implement convert_enumerate_command. |
Date: |
Sun, 31 Dec 2023 11:26:51 -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 4eb1386582 * tp/Texinfo/XS/convert/convert_html.c
(convert_enumerate_command) (commands_internal_conversion_table): implement
convert_enumerate_command.
4eb1386582 is described below
commit 4eb13865825b7763f66d57669a87a3addfb7590f
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Dec 31 17:26:51 2023 +0100
* tp/Texinfo/XS/convert/convert_html.c (convert_enumerate_command)
(commands_internal_conversion_table): implement
convert_enumerate_command.
---
ChangeLog | 6 +++
tp/Texinfo/XS/convert/convert_html.c | 81 ++++++++++++++++++++++++++++++++++++
2 files changed, 87 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 3aa76b68c2..fbbadd0e81 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_enumerate_command)
+ (commands_internal_conversion_table): implement
+ convert_enumerate_command.
+
2023-12-31 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/convert_html.c (convert_cartouche_command)
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 2447ba58cd..cb383585ec 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -11091,6 +11091,86 @@ convert_itemize_command (CONVERTER *self, const enum
command_id cmd,
text_append_n (result, "</ul>\n", 6);
}
+void
+convert_enumerate_command (CONVERTER *self, const enum command_id cmd,
+ const ELEMENT *element,
+ const HTML_ARGS_FORMATTED *args_formatted,
+ const char *content, TEXT *result)
+{
+ STRING_LIST *classes;
+ char *attribute_class;
+ const char *specification;
+
+ if (!content || !strlen (content))
+ return;
+
+ if (html_in_string (self))
+ {
+ text_append (result, content);
+ 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, "ol", classes);
+ destroy_strings_list (classes);
+ text_append (result, attribute_class);
+ free (attribute_class);
+
+ specification = lookup_extra_string (element,
+ "enumerate_specification");
+
+ if (specification)
+ {
+ unsigned int start = 0;
+ const char *type = 0;
+ size_t specification_len = strlen (specification);
+ if (specification_len == 1 && isascii_alpha (*specification))
+ {
+ if (isascii_lower (*specification))
+ {
+ start = 1 + (*specification - 'a');
+ type = "a";
+ }
+ else
+ {
+ start = 1 + (*specification - 'A');
+ type = "A";
+ }
+ }
+ else
+ {
+ const char *p = specification;
+ int only_digits = 1;
+ while (*p)
+ {
+ if (!isascii_digit (*p))
+ {
+ only_digits = 0;
+ break;
+ }
+ p++;
+ }
+ if (only_digits)
+ {
+ unsigned int spec_number = strtoul (specification, NULL, 10);
+ if (spec_number > 1)
+ start = spec_number;
+ }
+ }
+ if (type)
+ text_printf (result, " type=\"%s\"", type);
+ if (start)
+ text_printf (result, " start=\"%u\"", start);
+ }
+
+ text_append_n (result, ">\n", 2);
+ text_append (result, content);
+ text_append_n (result, "</ol>\n", 6);
+}
+
void
convert_xref_commands (CONVERTER *self, const enum command_id cmd,
const ELEMENT *element,
@@ -11789,6 +11869,7 @@ static COMMAND_INTERNAL_CONVERSION
commands_internal_conversion_table[] = {
{CM_smallquotation, &convert_quotation_command},
{CM_cartouche, &convert_cartouche_command},
{CM_itemize, convert_itemize_command},
+ {CM_enumerate, convert_enumerate_command},
{CM_verbatiminclude, &convert_verbatiminclude_command},
{CM_sp, &convert_sp_command},
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/convert/convert_html.c (convert_enumerate_command) (commands_internal_conversion_table): implement convert_enumerate_command.,
Patrice Dumas <=