Skip to main content

plain_text_from_html

Function plain_text_from_html 

Source
pub fn plain_text_from_html(html: &str) -> Result<String>
Expand description

The plain-text alternative for an HTML body, as Markdown.

htmd converts it, the converter gmail render uses for an HTML-only message. Markdown keeps links as [text](url), which stripping the tags would lose. A full HTML document’s <head>, <style> and <script> are left out, so an email template’s title and CSS don’t open the plain text. A failed conversion is an error, never raw HTML in the plain part.