Skip to main content

Module html

Module html 

Source
Expand description

text/html into readable text, rmut’s own few hundred lines: mutt shows html-only mail as raw source unless a mailcap filter is configured, and machines without lynx/w3m deserve better. This is the fallback the pager uses by default ([pager] html = "raw" restores mutt’s literal behavior); a [filters]/mailcap auto_view entry still wins, since it is consulted first.

The shape of the output, not fidelity, is the goal: block elements break lines, <blockquote> becomes > prefixes so the quote machinery works on html mail, links keep their targets as text <url> so the window can click them, and everything inside <style>/<script>/<head> disappears. Unknown tags are ignored rather than feared; broken html must never panic.

Functions§

to_text
The rendered text, one trailing newline, never more than one blank line in a row.