PackageTrack
Sign in Get early access

sanitize_html

Function for sanitizing HTML to prevent XSS by restrict elements and attributes to a safe subset of allowed values.

2.2.0 860K downloads/mo #388 most downloaded on pub.dev google/dart-neats

What this package is like to depend on

Last release 1 months ago

07 Jul 2026

Release timing varies

gaps range from 5 weeks to 2.8 years

Nearly every release is documented

notes for 9 of 9 stable releases

Nothing withdrawn

no release was ever pulled

7 years old

9 releases · first in 2019

1 release in the last 12 months

see the full history below

Release timeline

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

Releases

latest 9
  1. 2.2.0 07 Jul 2026
    Release notes
    • Allow the <picture> and <source> elements, with srcset on <source>, matching the html-pipeline allowlist this package is modeled on. Enables theme-aware images via <picture> with prefers-color-scheme.
    Open source →
    Release notes
    • Allow the <picture> and <source> elements, with srcset on <source>, matching the html-pipeline allowlist this package is modeled on. Enables theme-aware images via <picture> with prefers-color-scheme.
    Open source →
  2. 2.1.0 28 Sep 2023
    Release notes
    • Remove custom HTML rendering logic in favor of logic from package:html.
    • Added topics to pubspec.yaml.
    • rel attributes added through addLinkRel are appended to existing ones.
    Open source →
  3. 2.0.0 01 Mar 2021
    Release notes
    • Migrate to null safety.
    Open source →
  4. 1.4.1 15 Oct 2020
    Release notes
    • Make addLinkRel optional. Issue.
    Open source →
  5. 1.4.0 07 Oct 2020
    Release notes
    Open source →
  6. 1.3.0 26 Jun 2019
    Release notes
    • Only print self-closing tags for void-elements. This could cause <strong /> in HTML documents, which is can be interpreted as an opening tag by HTML5 parsers, causing the HTML structure to break.
    Open source →
  7. 1.2.0 22 May 2019
    Release notes
    • Does not depend on universal_html, uses custom HTML rendering for the output.
    • Allowed classes are kept, even if there are non-allowed classes present on the same element.
    Open source →
  8. 1.1.0 03 Apr 2019
    Release notes
    • Add options allowElementId and allowClassName to allow specific element ids and class names.
    Open source →
  9. 1.0.0 02 Apr 2019
    Release notes
    • Initial release.
    Open source →

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