## Text to HTML Conversion Text to HTML Conversion |

## Synopsis

    #define             E_TEXT_TO_HTML_PRE
    #define             E_TEXT_TO_HTML_CONVERT_NL
    #define             E_TEXT_TO_HTML_CONVERT_SPACES
    #define             E_TEXT_TO_HTML_CONVERT_URLS
    #define             E_TEXT_TO_HTML_MARK_CITATION
    #define             E_TEXT_TO_HTML_CONVERT_ADDRESSES
    #define             E_TEXT_TO_HTML_ESCAPE_8BIT
    #define             E_TEXT_TO_HTML_CITE
    gchar *             e_text_to_html_full                 (const gchar *input,
                                                             guint flags,
                                                             guint32 color);
    gchar *             e_text_to_html                      (const gchar *input,
                                                             guint flags);

## Description

## Details

### E_TEXT_TO_HTML_PRE

    #define E_TEXT_TO_HTML_PRE               (1 << 0)

### E_TEXT_TO_HTML_CONVERT_NL

    #define E_TEXT_TO_HTML_CONVERT_NL        (1 << 1)

### E_TEXT_TO_HTML_CONVERT_SPACES

    #define E_TEXT_TO_HTML_CONVERT_SPACES    (1 << 2)

### E_TEXT_TO_HTML_CONVERT_URLS

    #define E_TEXT_TO_HTML_CONVERT_URLS      (1 << 3)

### E_TEXT_TO_HTML_MARK_CITATION

    #define E_TEXT_TO_HTML_MARK_CITATION     (1 << 4)

### E_TEXT_TO_HTML_CONVERT_ADDRESSES

    #define E_TEXT_TO_HTML_CONVERT_ADDRESSES (1 << 5)

### E_TEXT_TO_HTML_ESCAPE_8BIT

    #define E_TEXT_TO_HTML_ESCAPE_8BIT       (1 << 6)

### E_TEXT_TO_HTML_CITE

    #define E_TEXT_TO_HTML_CITE              (1 << 7)

### e_text_to_html_full ()

    gchar *             e_text_to_html_full                 (const gchar *input,
                                                             guint flags,
                                                             guint32 color);

This takes a buffer of text as input and produces a buffer of "equivalent" HTML, subject to certain transformation rules.

The set of possible flags is:

- E_TEXT_TO_HTML_PRE: wrap the output HTML in <PRE> and </PRE> Should only be used if `input` is the entire buffer to be converted. If e_text_to_html is being called with small pieces of data, you should wrap the entire result in <PRE> yourself.

- E_TEXT_TO_HTML_CONVERT_NL: convert "\n" to "<BR>n" on output. (Should not be used with E_TEXT_TO_HTML_PRE, since that would result in double-newlines.)

- E_TEXT_TO_HTML_CONVERT_SPACES: convert a block of N spaces into N-1 non-breaking spaces and one normal space. A space at the start of the buffer is always converted to a non-breaking space, regardless of the following character, which probably means you don't want to use this flag on pieces of data that aren't delimited by at least line breaks.

If E_TEXT_TO_HTML_CONVERT_NL and E_TEXT_TO_HTML_CONVERT_SPACES are both defined, then TABs will also be converted to spaces.

- E_TEXT_TO_HTML_CONVERT_URLS: wrap <a href="..."> </a> around strings that look like URLs.

- E_TEXT_TO_HTML_CONVERT_ADDRESSES: wrap <a href="mailto:..."> </a> around strings that look like mail addresses.

- E_TEXT_TO_HTML_MARK_CITATION: wrap <font color="..."> </font> around citations (lines beginning with "> ", etc).

- E_TEXT_TO_HTML_ESCAPE_8BIT: flatten everything to US-ASCII

- E_TEXT_TO_HTML_CITE: quote the text with "> " at the start of each line.

`input` : | a NUL-terminated input buffer
`flags` : | some combination of the E_TEXT_TO_HTML_* flags defined in e-html-utils.h
`color` : | color for citation highlighting
Returns : | a newly-allocated string containing HTML

### e_text_to_html ()

    gchar *             e_text_to_html                      (const gchar *input,
                                                             guint flags);

`input` : |
`flags` : |
Returns : |