Skip to main content

Module text

Module text 

Source
Expand description

Text-based formats: plain text, delimited tables, HTML, subtitles.

Functionsยง

collapse_blank_lines
Trim each line and collapse runs of blank lines to one.
decode
Decode bytes as text: BOM-aware UTF-8/UTF-16, falling back to Windows-1252 (a superset of Latin-1) when the bytes are not valid UTF-8.
decode_entities
Decode the common named entities plus numeric character references.
html_to_text
Convert HTML to readable text. Scripts, styles and comments are dropped; block elements become line breaks. In Markdown mode headings become # lines and list items - lines.
markdown_table
Markdown table with the first row as header, using the default limits. Pipes and newlines in cells are escaped.
parse_delimited
Parse delimited text (CSV / TSV) into rows. Handles quoted fields with embedded delimiters, doubled quotes and newlines.
render_table
Render rows as text: Markdown table (first row = header) or tab-separated lines.
subtitles
Extract the cue text of WebVTT / SRT subtitles (timings, indexes and headers removed).