fputs (field, csv->file);
}
-static void PRINTF_FORMAT (2, 3)
-csv_output_field_format (struct csv_driver *csv, const char *format, ...)
-{
- va_list args;
- char *s;
-
- va_start (args, format);
- s = xvasprintf (format, args);
- va_end (args);
-
- csv_output_field (csv, s);
- free (s);
-}
-
static void
csv_format_footnotes (const struct footnote **f, size_t n, struct string *s)
{
if (i > 0)
ds_put_cstr (&s, "\n\n");
- ds_put_cstr (&s, c->text);
+ if (c->options & TAB_MARKUP)
+ {
+ char *t = output_get_text_from_markup (c->text);
+ ds_put_cstr (&s, t);
+ free (t);
+ }
+ else
+ ds_put_cstr (&s, c->text);
csv_format_footnotes (c->footnotes, c->n_footnotes, &s);
}
csv_output_field (csv, ds_cstr (&s));
enum text_item_type type = text_item_get_type (text_item);
const char *text = text_item_get_text (text_item);
- if (type == TEXT_ITEM_COMMAND_OPEN || type == TEXT_ITEM_COMMAND_CLOSE
- || type == TEXT_ITEM_SYNTAX)
+ if (type == TEXT_ITEM_SYNTAX || type == TEXT_ITEM_PAGE_TITLE)
return;
csv_put_separator (csv);
- switch (type)
+ if (text_item->markup)
{
- case TEXT_ITEM_TITLE:
- csv_output_field_format (csv, "Title: %s", text);
- break;
-
- case TEXT_ITEM_SUBTITLE:
- csv_output_field_format (csv, "Subtitle: %s", text);
- break;
-
- default:
- csv_output_field (csv, text);
- break;
+ char *plain_text = output_get_text_from_markup (text);
+ csv_output_field (csv, plain_text);
+ free (plain_text);
}
+ else
+ csv_output_field (csv, text);
putc ('\n', csv->file);
}
else if (is_message_item (output_item))
{
const struct message_item *message_item = to_message_item (output_item);
- const struct msg *msg = message_item_get_msg (message_item);
- char *s = msg_to_string (msg, message_item->command_name);
+ char *s = msg_to_string (message_item_get_msg (message_item));
csv_put_separator (csv);
csv_output_field (csv, s);
free (s);