#html-text #html-parser #convert-html #html #plain-text #text

bin+lib nanohtml2text

A zero-dependency library to convert HTML to plain text

5 releases

0.1.4 Sep 24, 2022
0.1.3 Apr 23, 2022
0.1.2 Jan 13, 2022
0.1.1 Jan 9, 2022
0.1.0 Jan 6, 2022

#125 in Email

Download history 301/week @ 2023-12-18 193/week @ 2023-12-25 184/week @ 2024-01-01 288/week @ 2024-01-08 196/week @ 2024-01-15 185/week @ 2024-01-22 193/week @ 2024-01-29 138/week @ 2024-02-05 316/week @ 2024-02-12 220/week @ 2024-02-19 229/week @ 2024-02-26 284/week @ 2024-03-04 285/week @ 2024-03-11 309/week @ 2024-03-18 198/week @ 2024-03-25 372/week @ 2024-04-01

1,206 downloads per month
Used in 8 crates (4 directly)

MIT license

80KB
2.5K SLoC

nanohtml2text

0-dependency library to convert HTML to text; an alternative to html2text that doesn't use a full browser-grade HTML parser

Based on this go html2text library

Primarily useful for displaying HTML emails as text. YMMV depending on the structure of the HTML you're trying to convert.

This library has one function, html2text, which takes a an html &str and returns a plain text String

On crates.io

Comes with a command line utility in main.rs to process from stdin if you want to test/experiment with it

Contributing

git-send-email or git-request-pull to my mailing list

No runtime deps