html2text
Render HTML as plain text.
0.17.1
5.6M downloads/mo
#4311 most downloaded on crates.io
jugglerchris/rust-html2text
What this package is like to depend on
Last release 4 months ago
19 Apr 2026
Ships fairly regularly
a new release about every 4 weeks
Most releases are documented
notes for 60 of 74 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
77 releases · first in 2016
12 releases in the last 12 months
see the full history below
Release timeline
77 releases · Dec 2016 to Apr 2026Releases
latest 60 of 77-
0.17.119 Apr 2026Release notes
Open source →- [added] Add support for XHTML (for the cases where it doesn't quite behave like HTML).
-
0.17.019 Apr 2026Release notes
Open source →- [changed] Split
html2textexample intohtml2text-clicrate - [fixed] A possible panic when syntax-highlighting
- [changed] Update html5ever to 0.39.0
- [changed] Split
-
0.16.729 Jan 2026Release notes
Open source →- [added] Support
<b>tags as bold (thanks amir) - [changed] Update html5ever to 0.38.0 (thanks mtorromeo)
- [added] Support
-
0.16.618 Jan 2026 -
0.16.506 Dec 2025Release notes
Open source →- [fixed] Fix a subtract with underflow with rowspans and empty rows (thanks mdierksen)
-
0.16.416 Nov 2025 -
0.16.316 Nov 2025Release notes
Open source →- [fixed] RcDom::serialize() panicked.
- [changed] Bumped html5ever dependency
- [fixed] Fixed a subtraction underflow in the
html2termexample.
-
0.16.209 Nov 2025 -
0.16.108 Nov 2025Release notes
Open source →- [added] Add
Config::empty_img_mode()to configure how images with no alt text are handled.
- [added] Add
-
0.16.022 Oct 2025Release notes
Open source →- [changed] Updated MSRV to 1.85.
- [fixed] Fix a panic in debug mode (subtraction underflow) with some table/rowspan edge cases (thanks mtorromeo)
-
0.15.507 Sep 2025Release notes
Open source →- [fixed] Fix an assertion and some missing styles with rowspan cells in rich mode.
-
0.15.407 Sep 2025 -
0.15.326 Jul 2025Release notes
Open source →- [fixed] Parse
<noscript>tags as if scripting is disabled (thanks craigchiang) - [fixed] Treat inline
<svg>as images (thanks craigchiang)
- [fixed] Parse
-
0.15.229 Jun 2025Release notes
Open source →- [fixed] Fix whitespace-only tables being shown as "─" (thanks fuelen)
- [fixed] Fix wrapping with non-breaking spaces, zero-width spaces, and some similar equivalents.
-
0.15.102 Jun 2025Release notes
Open source →- [added] CSS: Support basic attribute selectors (
div[attr="bar"]). - [changed] Various improvements to syntax highlighting:
- It uses the priority of the
x-syntaxrule. - Now supported on non-
<pre>elements. - No longer strips contained tags when highlighting
- Compatible with
display: x-raw-domextension (e.g. to colour the HTML)
- It uses the priority of the
- [fixed] With
pad_block_widthenabled, do a better job of padding blocks. In particular, the padding gets the block's background colour (when CSS etc. are being used).
- [added] CSS: Support basic attribute selectors (
-
0.15.011 May 2025Release notes
Open source →- [added] Syntax highlighting support for
<pre>blocks (Config::register_highlighterand CSSx-syntax: foo) - [changed] CSS extensions (until now
display: x-raw-dom, and only if thecss_extCargo feature is enabled) are now only available in agent and user CSS. This is a breaking change, but is not likely to affect many users.
- [added] Syntax highlighting support for
-
0.14.405 May 2025Release notes
Open source →- [added]
RcDom::serialize, and expose a few more of theRcDomtypes. - [added] Online demo page
- [added]
-
0.14.312 Apr 2025 -
0.14.213 Mar 2025Release notes
Open source →- [fixed] An issue with multiple verions of markup5ever being included. (thanks anna-hope)
-
0.14.102 Mar 2025Release notes
Open source →- [fixed] An issue with
FragmentStarts being lost (thanks toiletbril) - [fixed] An infinite loop if tabs inside
<pre>wrapped past the width (thanks nshp)
- [fixed] An issue with
-
0.14.009 Feb 2025Release notes
Open source →- [changed] Various small refactors (thanks sftse)
- [changed]
Config::rich()no longer includes decorations around<em>etc. - useConfig::rich().do_decorate()to get the old behaviour. - [fixed] Remove unnecessary empty lines at the start of lists (thanks russellbanks)
- [added] New CSS support:
::before/::afterandcontent: "string", which is now used for simple decorations. With CSS enabled, this allows for customising the display of<em>foo</em>without writing a decorator. - [added] Add support for
<h5>and<h6>(thanks noahbaculi) - [changed] Link footnotes are now configurable independently of the decorator, and on
by default for
config::plain()but can be enabled or disabled withconfig.link_footnotes(true/false). The footnote references (e.g.[1]) are added in the main renderer, and the actual footnotes are written in a default implementation ofTextDecorator::finalise()so can be customised.
-
0.13.620 Dec 2024Release notes
Open source →- [fixed] Fixed issue parsing CSS rules with known rules but unknown values, which caused parsing to stop instead of just skipping the unkown rule.
-
0.13.501 Dec 2024Release notes
Open source →- [added] CSS support for
:nth-child()(not yet with theof foo). - [added] Non-standard
display: x-raw-domfor debugging (withcss_extfeature flag). - [fixed] An issue which could (apparently rarely) miss out some output depending on wrapping
- [fixed] CSS parsing stopped when it hit an at-rule.
- [added] Add
--show-cssoption tohtml2textexample for debugging what rules were parsed. - [added] Add poor-man's inspect mode to
html2term-Ito enable/disable, and arrows to navigate around the DOM. Implemented using:nth-childandx-raw-dom.
- [added] CSS support for
-
0.13.423 Nov 2024Release notes
Open source →- [fixed] Fix a debug assertion from a double-counted length increment (thanks JadedBlueeyes).
-
0.13.310 Nov 2024Release notes
Open source →- [fixed] Handle some obsolete
bgcolor=...attributes. - [added] html2text example has
--show-renderto help debugging render issues. - [changed] Some error handling and other tidyups (thanks sftse)
- [fixed] Handle some obsolete
-
0.13.218 Oct 2024 -
0.13.116 Oct 2024Release notes
Open source →- [added] html2text now has --show-dom
- [fixed] Support background CSS property (for colour)
- [fixed] Some edge cases with CSS styles on whitespace
-
0.13.014 Oct 2024 -
0.13.0-alpha.211 Oct 2024 pre-releaseRelease notes
Open source →- [changed] Updated html5ever and markup5ever crate versions. This has meant updating the MSRV, which is now set to 1.72.
- [fixed] Add
Config::no_link_wrapping()(thanks JadeBlueEyes) - [fixed] Fix panic with empty table inside a list (thanks sftse)
- [changed] Top level convenience functions (
from_readetc.) now returnResult<..>instead of panicking (thanks sftse) - [fixed] Fix panic with very large HTML
colspan(thanks pycui) - [changed] CSS updates:
- Separate user agent, author, and user CSS layers
- Improve the style precedence between layers and implement specificity.
-
0.13.0-alpha.101 Jun 2024 pre-release -
0.13.0-alpha.026 May 2024 pre-releaseRelease notes
Open source →-
[changed] Replaced LightningCSS with a smaller CSS parser. There is a chance that some CSS edge cases which no longer work; if so this would be a bug.
-
[removed] Some previously
pubitems and methods which are either internal implementation details or considered redundant have been removed or made private (thanks sftse). Please open an issue for anything removed that was being used.Of note,
RenderTree::render_plain()andRenderTree::render_rich()have been removed. Replace code like:let text = html2text::parse(html)? .render_plain(80)? .into_string()?;with:
let text = html2text::config::plain() .render_to_string(html2text::parse(html)?)? -
[changed] Some names moved out of
text_renderermodule, so someusestatements may need updating. -
[changed] Replace some
unwrap()with improved patterns (thanks sftse). -
[changed] Updated some dependencies
-
-
0.12.601 Oct 2024Nothing published for this version
-
0.12.505 May 2024Release notes
Open source →- [changed] Updated some dependencies
- [added] The
html2textexample now has--ignore-css-colour, which ignores CSS colour information but still usesdisplay: none, for example. - [added] The
html2textexample now has--only-cssoption, to not use default colours when CSS colours are being used. - [fixed] Make the dummy
dashmapdepenency optional so it's not included unnecessarily when CSS isn't enabled (thanks xmakro)
-
0.12.403 Mar 2024Release notes
Open source →- [changed] Update the previous
max-height: 0to also look atheight: 0and requireoverflow: hiddenas well. This helps with a hack some e-mail senders use for e-mail previews. (thanks tkapias)
- [changed] Update the previous
-
0.12.303 Mar 2024Release notes
Open source →- [changed] Treat
max-height: 0as if it'sdisplay: nonewhen CSS is enabled. This helps with a hack some e-mail senders use for e-mail previews. (thanks tkapias)
- [changed] Treat
-
0.12.223 Feb 2024Release notes
Open source →- [changed] Bump version of lightningcss dependency to fix build failures.
-
0.12.119 Feb 2024Release notes
Open source →- [fixed] Fix a case where Err(TooNarrow) was returned unnecessarily. (thanks sftse)
- [added] Add new rendering options
Config::raw_mode()andConfig::no_table_borders()(thanks sftse) - [changed] Formatting, clippy and other tidy-ups (thanks sftse)
- [changed] Cargo fmt now enforced in CI
-
0.12.021 Jan 2024Release notes
Open source →- [changed] Updated termion dev-dependency
- [added] Support
<sup>HTML elements - [added] Export
RcDompublically. It was already returned by a pub function. - [added] Update handling of width overflow:
With
Config::allow_width_overflow(), prefer returning output wider than requested, instead of returningErr(TooNarrow).Config::min_wrap_width()sets the minimum text wrap width (default 3). The minimum width (before overflow orTooNarrow) is now handled more cleanly. - [added] CSS: use color/bgcolor attributes on elements.
-
0.11.013 Jan 2024Release notes
Open source →- [fixed] CSS: rules marked !important were ignored.
- [changed] html_trace feature now uses the
logcrate. - [changed] Bumped MSRV to 1.63 (matching Debian stable) due to some dependencies.
-
0.10.312 Jan 2024Release notes
Open source →- [fixed] A panic on some unlucky text wrapping coincidences.
- [fixed] Use dep:backtrace in Cargo.toml to avoid implicit feature.
-
0.10.206 Jan 2024 -
0.10.102 Jan 2024 -
0.10.002 Jan 2024Release notes
Open source →- [added] Simple support for
<i>,<ins>, and<del>(thanks sgtatham) - [added] Added background-color support
- [fixed] CSS support didn't work in some places, such as
<td>elements. - [added] Add support for
styleattributes. - [added] Styles apply to table borders
- [changed] Update some dependencies
- [fixed] Fix a few places which caused excess blank lines or empty tables
- [added] Simple support for
-
0.9.431 Dec 2023 -
0.9.331 Dec 2023 -
0.9.229 Dec 2023Release notes
Open source →- [fixed] CSS didn't work inside
<ul>or<ol>. - [added] Add methods to get and use the intermediate HTML DOM and RenderTree from Config.
- [fixed] Removed some clones which are no longer necessary now that Box<FnOnce> works.
- [fixed] CSS didn't work inside
-
0.9.127 Dec 2023Release notes
Open source →- [fixed] Various documentation issues (thanks sgtatham)
- [changed] CSS color rules now work for elements other than span.
-
0.9.022 Dec 2023Release notes
Open source →- [changed]
Config::add_cssnow returnsResultinstead of panicking on CSS parse errors. Errors from parsing document CSS are ignored. - [added] Support
<font color=...>when CSS is enabled. - [added]
Config::max_wrap_width()to wrap text to a norrower width than the overal size available. - [added] Add --wrap-width and --css options to html2text example.
- [changed]
-
0.8.021 Dec 2023Release notes
Open source →- [added] CSS: Support more extensive selectors
- [changed] CSS handling defaults to off; use
Config::use_doc_css()orConfig::add_cssto use CSS.
-
0.7.116 Dec 2023Release notes
Open source →- [added] Now recognised CSS
display:none - [added] Can now add extra CSS rules via
Config::add_css. - [changed] StyleData::coloured is no longer public.
- [added] Now recognised CSS
-
0.7.015 Dec 2023Release notes
Open source →- [changed] Remove some noisy stderr output when encoutering control chars (thanks sftse)
- [added] A builder-based config API.
- [changed] Updated MSRV to 1.60
- [fixed] Fixed #88: panic when a width of zero passed in (thanks bingen13)
- [fixed] Fixed #90: Fixed a divide-by-zero panic with colspan=0 (thanks mtorromeo)
- [added] Add very basic CSS colour support (under the css feature flag)
- [changed] Removed ansi_colours feature (from_read_coloured is always available)
- [changed] Overhauled error handling. Internally (and in the lower level
API) errors (mainly "TooNarrow") are passed around with
Result. Fixed some panics and infinite loops. (Thanks WIZeaz for fuzzing)
-
0.6.023 May 2023Release notes
Open source →- [changed] Improve layout of tables thanks to sftse:
- Table column size estimates have been improved when the source HTML has a lot of unnecessary whitespace.
- Move the URL footnotes out to the top level, also improving layout of tables containing links.
- [changed] Some APIs have slightly changed as part of the table improvements, though most users should not be affeted.
- [changed] Improve layout of tables thanks to sftse:
-
0.5.102 Apr 2023 -
0.5.004 Mar 2023Release notes
Open source →- [changed] Rich Image annotations now include the src attirbute (thanks spencerwi).
-
0.4.507 Jan 2023 -
0.4.407 Nov 2022Release notes
Open source →- [fixed] Fix some panics when enumerated lists are in tables (thanks sfts).
- [fixed] Impove table size estimation to include links.
-
0.4.316 Oct 2022Release notes
Open source →- [changed] MSRV is now 1.56.
- [fixed] Fix some panics when very large widths are used with tables.
-
0.4.224 Apr 2022 -
0.3.106 Mar 2022Release notes
Open source →- [changed] Update the build badges to reflect the updated CI configuration.
-
0.3.006 Mar 2022Release notes
Open source →- [added] New experimental
from_read_coloured()(underansi_coloursfeature). - [added] Add
into_tagged_stringsandtagged_stringsmethods toTaggedLine(thanks Robin Krahl) - [added] Add
widthmethod toTaggedString(thanks Robin Krahl) - [changed] Keep annotations in
TextRenderer::into_lines(thanks Robin Krahl) - [fixed] Add colon to reference style link (thanks zakaluka)
- [added] Allow text decorators to customise block prefix strings (thanks SardineFish)
- [fixed] Fixed some problems rendering some complicated tables, including a panic and near-infinite loops.
- [changed] Tables which are too wide to possibly render in the given width are now
arranged vertically instead (with
///) lines. - [changed] A number of small table rendering improvements.
- [changed] MSRV is now 1.41.
- [added] New experimental