NetSurf
|
Text export of HTML (interface). More...
Go to the source code of this file.
Data Structures | |
struct | save_text_state |
Enumerations | |
enum | save_text_whitespace { WHITESPACE_NONE , WHITESPACE_TAB , WHITESPACE_ONE_NEW_LINE , WHITESPACE_TWO_NEW_LINES } |
Functions | |
void | save_as_text (struct hlcache_handle *c, char *path) |
Extract the text from an HTML content and save it as a text file. More... | |
void | save_text_solve_whitespace (struct box *box, bool *first, save_text_whitespace *before, const char **whitespace_text, size_t *whitespace_length) |
Decide what whitespace to place before the next bit of content-related text that is saved. More... | |
Text export of HTML (interface).
Definition in file save_text.h.
enum save_text_whitespace |
Enumerator | |
---|---|
WHITESPACE_NONE | |
WHITESPACE_TAB | |
WHITESPACE_ONE_NEW_LINE | |
WHITESPACE_TWO_NEW_LINES |
Definition at line 37 of file save_text.h.
void save_as_text | ( | struct hlcache_handle * | c, |
char * | path | ||
) |
Extract the text from an HTML content and save it as a text file.
Text is converted to the local encoding.
c | An HTML content. |
path | Path to save text file too. |
Definition at line 57 of file save_text.c.
References save_text_state::block, content_get_type(), CONTENT_HTML, extract_text(), guit, html_get_box_tree(), save_text_state::length, NSERROR_OK, NSLOG, path(), result, netsurf_table::utf8, gui_utf8_table::utf8_to_local, and WHITESPACE_NONE.
Referenced by ami_file_save(), plaintext_button_clicked_cb(), and ro_gui_save_content().
void save_text_solve_whitespace | ( | struct box * | box, |
bool * | first, | ||
save_text_whitespace * | before, | ||
const char ** | whitespace_text, | ||
size_t * | whitespace_length | ||
) |
Decide what whitespace to place before the next bit of content-related text that is saved.
Any existing whitespace is overridden if the whitespace for this box is more "significant".
box | Pointer to box. |
first | Whether this is before the first bit of content-related text to be saved. |
before | Type of whitespace currently intended to be placed before the next bit of content-related text to be saved. Updated if this box is worthy of more significant whitespace. |
whitespace_text | Whitespace to place before next bit of content-related text to be saved. Updated if this box is worthy of more significant whitespace. |
whitespace_length | Length of whitespace_text. Updated if this box is worthy of more significant whitespace. |
Definition at line 125 of file save_text.c.
References BOX_BLOCK, BOX_BR, BOX_FLOAT_LEFT, BOX_FLOAT_RIGHT, BOX_INLINE, BOX_INLINE_CONTAINER, BOX_TABLE, BOX_TABLE_CELL, BOX_TABLE_ROW, box::list_marker, box::parent, box::style, box::type, WHITESPACE_NONE, WHITESPACE_ONE_NEW_LINE, WHITESPACE_TAB, and WHITESPACE_TWO_NEW_LINES.
Referenced by extract_text(), and selection_copy().