Skip to main content

Module render

Module render 

Source
Expand description

Text rendering shared by the CLI and the MCP server: HTML → text and quoted-history stripping. Pure functions, no terminal assumptions.

Enums§

LinkStyle
How <a href> spans are rendered.

Functions§

collapse_blank_runs
Collapse runs of 3+ blank lines down to 2, and strip tracking-pixel padding characters that marketing emails use to distort preview-pane summaries: zero-width non-joiner (U+200C), zero-width space (U+200B), hair space (U+200A), and combining grapheme joiner (U+034F).
render_html
Render an HTML body to text.
strip_controls
Removes control characters from third-party text before it can reach a terminal: everything char::is_control matches (C0, DEL, C1) except \n, \r and \t. An e-mail can otherwise carry ESC ] 8 ; ; to forge a hyperlink, move the cursor over earlier lines, retitle the window, or write the clipboard. Applied where Graph data becomes pidge-core types, and again on rendered HTML (entities decode late).
strip_quoted_history
Cut a plain-text body at the first sign of quoted history: an Outlook header block (From: followed within three lines by Sent:/Subject:), an On … wrote: line, or the first run of >-quoted lines.