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

bin+lib nanohtml2text

A zero-dependency library to convert HTML to plain text

8 releases

0.2.1 Oct 8, 2024
0.2.0 Oct 4, 2024
0.1.5 Sep 28, 2024
0.1.4 Sep 24, 2022
0.1.2 Jan 13, 2022

#257 in Text processing

Download history 268/week @ 2024-08-22 298/week @ 2024-08-29 293/week @ 2024-09-05 176/week @ 2024-09-12 251/week @ 2024-09-19 435/week @ 2024-09-26 563/week @ 2024-10-03 312/week @ 2024-10-10 153/week @ 2024-10-17 124/week @ 2024-10-24 156/week @ 2024-10-31 164/week @ 2024-11-07 232/week @ 2024-11-14 309/week @ 2024-11-21 183/week @ 2024-11-28 450/week @ 2024-12-05

1,199 downloads per month
Used in 10 crates (4 directly)

MIT license

77KB
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 me

No runtime deps