Convert HTML to plain text using html2text (handles encoding, tags, scripts, etc.)
(html: &str)
| 149 | |
| 150 | /// Convert HTML to plain text using html2text (handles encoding, tags, scripts, etc.) |
| 151 | fn html_to_text(html: &str) -> String { |
| 152 | html2text::from_read(html.as_bytes(), 120) |
| 153 | .unwrap_or_else(|_| String::from("[failed to parse HTML]")) |
| 154 | } |
| 155 | |
| 156 | /// Convert HTML to markdown using htmd |
| 157 | fn html_to_markdown(html: &str) -> String { |
no outgoing calls