Skip to content

Releases: danielparks/htmlize

Release 1.0.5

15 Mar 06:00
v1.0.5
5d068b1
Compare
Choose a tag to compare
  • Exclude more files from final package to significantly reduce package size.

Release 1.0.4

19 Feb 07:07
v1.0.4
f6a0ab6
Compare
Choose a tag to compare
  • 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.

Release 1.0.3

10 Jul 05:36
v1.0.3
f9b7513
Compare
Choose a tag to compare
  • 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.

Release 1.0.2

04 Mar 23:24
v1.0.2
1c71036
Compare
Choose a tag to compare
  • 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.

Release 1.0.1

04 Mar 22:55
v1.0.1
4312558
Compare
Choose a tag to compare
  • Fix docs.rs build to enable the unescape and entities features.

Release 1.0.0

04 Mar 03:24
v1.0.0
61c4987
Compare
Choose a tag to compare

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 “�”).

0.5.1: Trivial clean up and fixes

13 Dec 12:28
0.5.1
81cd4cd
Compare
Choose a tag to compare

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.

0.5.0: miscellaneous

12 Dec 13:09
0.5.0
b41be95
Compare
Choose a tag to compare

Remove private macros from docs, rename function, and expand README.