PackageTrack
Sign in Get early access

htmlize

Correctly encode and decode HTML entities in UTF-8

1.1.0 4.5M downloads/mo #4758 most downloaded on crates.io danielparks/htmlize

What this package is like to depend on

Last release 4 months ago

13 Apr 2026

Release timing varies

gaps range from 3 weeks to 3.0 years

Most releases are documented

notes for 9 of 11 stable releases

Nothing withdrawn

no release was ever pulled

7 years old

11 releases · first in 2019

1 release in the last 12 months

see the full history below

Release timeline

11 releases · Dec 2019 to Apr 2026
2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 11
  1. 1.1.0 13 Apr 2026
    Release notes
    • Major performance improvements when unescaping text in many cases (for both the unescape and unescape_fast features).
    • Major improvements in build time for the unescape_fast features (went from 8 seconds to 3 seconds on my laptop).
    • Add BARE_ENTITY_MAX_LENGTH constant that contains the length of the longest entity without a semicolon (enabled with feature entities).
    • Clarify examples in documentation and README.
    • Fix a few spelling mistakes in documentation.

    Security

    Open source →
    Release notes
    • Major performance improvements when unescaping text in many cases (for both the unescape and unescape_fast features).
    • Major improvements in build time for the unescape_fast features (went from 8 seconds to 3 seconds on my laptop).
    • Add BARE_ENTITY_MAX_LENGTH constant that contains the length of the longest entity without a semicolon (enabled with feature entities).
    • Clarify examples in documentation and README.
    • Fix a few spelling mistakes in documentation.

    Security

    Open source →
  2. 1.0.6 27 Apr 2025
    Release notes
    • Switch dependency from paste, which is no longer maintained, to a new fork, pastey, which is.
    Open source →
    Release notes
    • Switch dependency from paste, which is no longer maintained, to a new fork, pastey, which is.
    Open source →
  3. 1.0.5 15 Mar 2024
    Release notes
    • Exclude more files from final package to significantly reduce package size.
    Open source →
    Release notes
    • Exclude more files from final package to significantly reduce package size.
    Open source →
  4. 1.0.4 19 Feb 2024
    Release notes
    • Hide usage of assert2 in doc examples to make them slightly clearer for users not familiar with it.

    Security fixes

    • Upgrade indirect dependency rustix to fix a security vulnerability in directory iterators. This does not affect htmlize, since rustix is only used by development dependencies.
    Open source →
    Release notes
    • Hide usage of assert2 in doc examples to make them slightly clearer for users not familiar with it.

    Security fixes

    • Upgrade indirect dependency rustix to fix a security vulnerability in directory iterators. This does not affect htmlize, since rustix is only used by development dependencies.
    Open source →
  5. 1.0.3 10 Jul 2023
    Release notes
    • Enabled feature marks on docs.rs to make it clearer what features are required by what functions.
    • Clarified ownership and licensing of entities.json data file.
    Open source →
    Release notes
    • Enabled feature marks on docs.rs to make it clearer what features are required by what functions.
    • Clarified ownership and licensing of entities.json data file.
    Open source →
  6. 1.0.2 04 Mar 2023
    Release notes
    • Fix building with unescape feature but not unescape_fast. Added tests for
      a few common feature flags — in addition to --all-features — to the CI check
      to avoid this sort of problem in the future.
    Open source →
    Release notes
    • Fix building with unescape feature but not unescape_fast. Added tests for a few common feature flags — in addition to --all-features — to the CI check to avoid this sort of problem in the future.
    Open source →
  7. 1.0.1 04 Mar 2023
    Release notes
    • Fix docs.rs build to enable the unescape and entities features.
    Open source →
    Release notes
    • Fix docs.rs build to enable the unescape and entities features.
    Open source →
  8. 1.0.0 04 Mar 2023
    Release notes

    Breaking changes

    • Hid unescape() behind unescape feature. This allows users to avoid the
      dependency on phf and the build dependency on serde_json, which cuts build
      times on my machine by more than 90% (from 6.2 seconds to 0.5 seconds).
    • Hid ENTITIES behind entities features for the same reason I added the
      unescape feature. Note that the unescape feature automatically enables
      the entities feature, but unescape_faster does not.
    • Switched both escape and unescape functions to use Cow<'a, str> for input
      and output. This allows for significant performance improvements when the
      input can be returned unchanged.
    • Updated minimum supported Rust version (MSRV) to 1.60.

    Improvements

    • Significantly optimized both escape and unescape functions. Many of the
      improvements to the escape functions are similar to the ones outlined in Lise
      Henry’s excellent post on optimizing HTML entity escaping
      (see also: its Reddit discussion), though most notably I’m
      using memchr directly rather than regex.
    • Added unescape_faster feature for even faster unescaping at the cost of
      longer build times (about 30 seconds longer on my machine).
    • Added unescape_attribute() to handle the special rules for dealing with
      entities in the value of an HTML attribute. Also adds unescape_in(), which
      takes a context parameter that can either be Context::Attribute or
      Context::General (for everything else).
    • Added unescape_bytes_in() to work on [u8] rather than str.
    • Added escape_..._bytes() functions to work on [u8] rather than str.
    • Switched to the phf_codegen crate instead of using the phf_map! macro.
      On my machine, this cuts build time by about 25% (~2 seconds).
    • Clarified documentation of ENTITIES to indicate that it’s a Map, not just
      a collection of tuples.

    Bug fixes

    • unescape() incorrectly outputted the replacement character (U+FFFD “�”) for
      certain numeric entities:

      A close reading of the spec and some browser testing shows that behavior to
      be incorrect. Those characters are now outputted as themselves.

    • unescape() incorrectly outputted long numeric entities as the literal text
      of the entity.

      A close reading of the spec and some browser testing shows that behavior to
      be incorrect. Those long entities are now outputted as the replacement
      character (U+FFFD “�”).

    Open source →
    Release notes

    Breaking changes

    • Hid unescape() behind unescape feature. This allows users to avoid the dependency on phf and the build dependency on serde_json, which cuts build times on my machine by more than 90% (from 6.2 seconds to 0.5 seconds).
    • Hid ENTITIES behind entities features for the same reason I added the unescape feature. Note that the unescape feature automatically enables the entities feature, but unescape_faster does not.
    • Switched both escape and unescape functions to use Cow<'a, str> for input and output. This allows for significant performance improvements when the input can be returned unchanged.
    • Updated minimum supported Rust version (MSRV) to 1.60.

    Improvements

    • Significantly optimized both escape and unescape functions. Many of the improvements to the escape functions are similar to the ones outlined in Lise Henry’s excellent post on optimizing HTML entity escaping (see also: its Reddit discussion), though most notably I’m using memchr directly rather than regex.
    • Added unescape_faster feature for even faster unescaping at the cost of longer build times (about 30 seconds longer on my machine).
    • Added unescape_attribute() to handle the special rules for dealing with entities in the value of an HTML attribute. Also adds unescape_in(), which takes a context parameter that can either be Context::Attribute or Context::General (for everything else).
    • Added unescape_bytes_in() to work on [u8] rather than str.
    • Added escape_..._bytes() functions to work on [u8] rather than str.
    • Switched to the phf_codegen crate instead of using the phf_map! macro. On my machine, this cuts build time by about 25% (~2 seconds).
    • Clarified documentation of ENTITIES to indicate that it’s a Map, not just a collection of tuples.

    Bug fixes

    • unescape() incorrectly outputted the replacement character (U+FFFD “�”) for certain numeric entities:

      A close reading of the spec and some browser testing shows that behavior to be incorrect. Those characters are now outputted as themselves.

    • unescape() incorrectly outputted long numeric entities as the literal text of the entity.

      A close reading of the spec and some browser testing shows that behavior to be incorrect. Those long entities are now outputted as the replacement character (U+FFFD “�”).

    Open source →
  9. 0.5.1 13 Dec 2022
    Release notes

    Bugfixes

    • Switched from assertify (deprecated) to assert2 for testing.
    • Fixed typo of in docs: “entries.json” should have been “entities.json”.
    • Fixed formatting and lints.
    • Added this change log.
    Open source →
    Release notes

    0.5.1: Switch to assert2, fix docs, add change log.

    Open source →
    Release notes

    Bug fixes

    • Switched from assertify (deprecated) to assert2 for testing.
    • Fixed typo of in docs: “entries.json” should have been “entities.json”.
    • Fixed formatting and lints.
    • Added this change log.
    Open source →
  10. 0.5.0 18 Dec 2019

    Nothing published for this version

  11. 0.1.0 12 Dec 2019

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive