| Top |
Renders HTML as plain text with optional link destinations and image alternative text. Lists, quotations and preformatted text retain their plain-text structure, and generated line endings are LF.
Length limits count Unicode scalar values rather than bytes or UTF-16 code units. Headers and footers are copied as plain text and are not included in the input or output length limits.
GMimeTextConverter *
g_mime_html_to_text_new (void);
Creates an HTML to plain-text converter. Link URLs and image alternative text are included by default. Generated line endings are LF; configured headers and footers are copied as plain text.
gboolean
g_mime_html_to_text_get_output_link_urls
(GMimeHtmlToText *converter);
Gets whether link destinations are included in the output.
void g_mime_html_to_text_set_output_link_urls (GMimeHtmlToText *converter,gboolean value);
Controls whether a link's URL is appended in parentheses when its visible text differs from the URL. Empty links output the URL alone. Disabling this option preserves visible link text but omits the destination.
gboolean
g_mime_html_to_text_get_output_image_alt_text
(GMimeHtmlToText *converter);
Gets whether image alternative text is included in the output.
void g_mime_html_to_text_set_output_image_alt_text (GMimeHtmlToText *converter,gboolean value);
Controls whether an image's alternative text is rendered as plain text. Images without an alt attribute contribute no text.
guint
g_mime_html_to_text_get_max_element_depth
(GMimeHtmlToText *converter);
Gets the tokenizer's maximum number of distinct open-element stack entries.
void g_mime_html_to_text_set_max_element_depth (GMimeHtmlToText *converter,guint value);
Limits the tokenizer's distinct open-element stack entries. After this limit is exceeded, the remaining input is treated as literal text rather than parsed as markup.
gsize
g_mime_html_to_text_get_max_input_length
(GMimeHtmlToText *converter);
Gets the input length limit in Unicode scalar values, including HTML markup but excluding the configured header and footer.
void g_mime_html_to_text_set_max_input_length (GMimeHtmlToText *converter,gsize value);
Limits decoded HTML input, including markup. The limit counts Unicode scalar values, not bytes or UTF-16 code units. Exceeding it causes conversion to fail with an error.
gsize
g_mime_html_to_text_get_max_output_length
(GMimeHtmlToText *converter);
Gets the rendered text length limit in Unicode scalar values. Configured headers and footers do not count toward this limit.
void g_mime_html_to_text_set_max_output_length (GMimeHtmlToText *converter,gsize value);
Limits the rendered body text before output charset encoding. Headers and footers are excluded. Exceeding the limit causes conversion to fail with an error.