PackageTrack
Sign in Get early access

voku/html-min

HTML Compressor and Minifier

5.0.0 5.2M downloads/mo #2364 most downloaded on Packagist voku/HtmlMin

What this package is like to depend on

Last release 4 months ago

23 Apr 2026

Ships unpredictably

gaps range from 2 weeks to 2.0 years

Most releases are documented

notes for 44 of 63 stable releases

Nothing withdrawn

no release was ever pulled

10 years old

63 releases · first in 2016

1 release in the last 12 months

see the full history below

Release timeline

62 releases · Oct 2016 to Apr 2026
2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 60 of 63
  1. 5.0.0 23 Apr 2026
    Release notes
    • add doRemoveCommentsOnly() for removing regular HTML comments without applying other minification changes
    • add opt-in inline JavaScript minification via doMinifyJavaScript() (uses tedivm/jshrink)
    • add doRemoveDataAttributes() option to drop all data-* attributes (disabled by default)
    • expand doRemoveOmittedHtmlTags() to cover more WHATWG optional-tag rules (html, head, body, colgroup, tbody, rt, newer p followers, and hr handling for option / optgroup)
    • improve same-domain URL handling: doMakeSameDomainsLinksRelative() now accepts a plain true flag; use the new fluent setLocalDomains(array) helper to configure domains separately
    • fix PHP 8.5 deprecation warnings: replace SplObjectStorage-based observer registration with an array-keyed map to avoid duplicates
    • fix optional-tag omission around comments, protected comments, autonomous custom elements, and blocked body starts (meta, link, noscript, script, style, template)
    • fix optional-tag omission when preserving inter-tag whitespace or comments so table sections and sibling tags still round-trip to the same DOM
    • fix <script type="application/ld+json"> whitespace minification preserving valid JSON
    • fix nested protected child-node restoration (nocompress blocks, special script tags)
    • fix whitespace around inline tags (<b>, <em>, <i>, <strong>, <u>) not being preserved correctly
    • fix standalone <head> and <body> fragment closing-tag omission
    • fix UTF-8 non-breaking space characters being incorrectly stripped
    • fix PHP 8.3 id attribute handling triggering a type error
    • fix text/html script-template tags leaking internal simple_html_dom placeholders
    • fix xml:lang attribute being lost and trim script-tag whitespace for PHP 7.x compatibility
    • internal: extract patchSimpleHtmlDomPlaceholders() as an idempotent Reflection-based method for simple_html_dom v5 compatibility
    • upgrade voku/simple_html_dom dependency to ^5.0; add tedivm/jshrink ^1.8.1; require PHP >=7.1
    • update CI matrix to cover PHP 7.1 – 8.5; refresh GitHub Actions (checkout v6, cache v5, upload-artifact v7, codecov v6)
    Open source →
  2. 4.5.1 25 May 2024
    Release notes

    [*]: update the changelog

    Open source →
    Release notes
    • "fix SimpleHtmlDom::__construct(): Argument #1 ($node) must be of type DOMNode, null given" (thanks @frugan-dev)
    Open source →
  3. 4.5.0 09 Jun 2022
    Release notes

    [*]: update the changelog

    Open source →
    Release notes
    • added possibility overwrite special script tags on minify process (thanks @hryvinskyi)
    • fix some PHP 8.1 type errors
    Open source →
  4. 4.4.10 13 Mar 2022
    Release notes

    [*]: update the changelog

    Open source →
    Release notes
    • use a new version of "voku/simple_html_dom" (4.8.5)
    • phpstan reported errors fixed
    Open source →
  5. 4.4.9 09 Mar 2022
    Release notes

    [*]: update the changelog

    Open source →
    Release notes
    • optimize regex for gigantic inputs
    • use a new version of "voku/simple_html_dom" (4.8.4)
    Open source →
  6. 4.4.8 11 Aug 2020
    Release notes

    [+]: remove content before "<!doctype.*>", otherwise DOMDocument cann…

    Open source →
    Release notes
    • remove content before "<!doctype.*>", otherwise DOMDocument cannot handle the input
    • use a new version of "voku/simple_html_dom" (4.7.22)
    Open source →
  7. 4.4.7 10 Aug 2020
    Release notes

    [*]: update the changelog

    Open source →
    Release notes
    • use a new version of "voku/simple_html_dom" (4.7.21)
    Open source →
  8. 4.4.6 08 Aug 2020
    Release notes

    [*]: update the changelog

    Open source →
    Release notes
    • fix invalid input html
    Open source →
  9. 4.4.5 05 Aug 2020
    Release notes

    [*]: update the changelog

    Open source →
    Release notes
    • allow to configure special comments via "setSpecialHtmlComments()"
    Open source →
  10. 4.4.4 05 Aug 2020
    Release notes

    [+]: ignore false-positiv errors from phpstan

    Open source →
    Release notes
    • fix problems with self-closing-tags e.g. <wbr>
    Open source →
  11. 4.4.3 06 Apr 2020
    Release notes
    • fix "domNodeClosingTagOptional()" -> fix logic of detecting next sibling dom node
    Open source →
  12. 4.4.2 05 Apr 2020
    Release notes
    • fix "domNodeClosingTagOptional()" -> do not remove "</p>" if there is more content in the parent node
    Open source →
  13. 4.4.1 05 Apr 2020
    Release notes
    • use a new version of "voku/simple_html_dom" (4.7.16)
    Open source →
  14. 4.4.0 05 Apr 2020
    Release notes
    • add support for removing more default attributes
    • add "doRemoveDefaultTypeFromButton()"
    • add "doRemoveDefaultMediaTypeFromStyleAndLinkTag()"
    • add "doRemoveDeprecatedTypeFromStyleAndLinkTag()"
    • add "overwriteTemplateLogicSyntaxInSpecialScriptTags()"
    • use a new version of "voku/simple_html_dom" (4.7.15)
    Open source →
  15. 4.3.0 22 Mar 2020
    Release notes
    • add "isHTML4()"
    • add "isXHTML()"
    • fix "remove deprecated script-mime-types"
    • use a new version of "voku/simple_html_dom" (4.7.13)
    Open source →
  16. 4.2.0 05 Mar 2020
    Release notes
    • add "doKeepHttpAndHttpsPrefixOnExternalAttributes(bool)": keep http:// and https:// prefix for external links | thanks @abuyoyo
    • add "doMakeSameDomainsLinksRelative(string[] $localDomains)": make the local domains relative | thanks @abuyoyo
    • optimized "optgroup"-html compressing
    • use a new version of "voku/simple_html_dom" (4.7.12)
    Open source →
  17. 4.1.0 06 Feb 2020
    Release notes
    • add "doRemoveHttpsPrefixFromAttributes()": remove optional "https:"-prefix from attributes (depends on "doOptimizeAttributes(true)")
    Open source →
  18. 4.0.7 18 Nov 2019
    Release notes
    • fix: too many single white spaces are removed
    Open source →
  19. 4.0.6 27 Oct 2019
    Release notes
    • fix: fix regex for self-closing tags
    • optimize performance via "strpos" before regex
    Open source →
  20. 4.0.5 19 Sep 2019
    Release notes
    • fix: protect "nocompress"-tags before notifying the Observer
    Open source →
  21. 4.0.4 17 Sep 2019
    Release notes
    • fix: removing of dom elements
    Open source →
  22. 4.0.3 17 Sep 2019
    Release notes
    • fix: removing of "</p>"-tags
    Open source →
  23. 4.0.2 13 Sep 2019
    Release notes
    • use new version of "voku/simple_html_dom"
    Open source →
  24. 4.0.1 30 Aug 2019
    Release notes
    • optimize unicode support
    • fix: remove unnecessary </source> closing tag #40
    • fix: bad minify text/x-custom-template #38
    Open source →
  25. 4.0.0 17 Aug 2019
    Release notes
    • use interfaces in the "HtmlMinDom"-Observer

    -> this is a BC, but you can simply replace this classes in your observer implementation:

    ---> "SimpleHtmlDom" with "SimpleHtmlDomInterface

    ---> "HtmlMin" with "HtmlMinInterface"

    Open source →
  26. 3.1.8 19 Jun 2019
    Release notes
    • fix / optimize: "doRemoveOmittedQuotes" -> support for "<html ⚡>" via SimpleHtmlDom
    Open source →
  27. 3.1.7 08 Jun 2019
    Release notes
    • fix: "'" && '"' in attributes
    Open source →
  28. 3.1.6 04 Mar 2019
    Release notes
    • fix: keep HTML closing tags in <script> tags
    Open source →
  29. 3.1.5 28 Feb 2019
    Release notes
    • fix: keep newlines in e.g. "pre"-tags
    • fix: remove newlines from "srcset" and "sizes" attribute
    Open source →
  30. 3.1.4 28 Feb 2019
    Release notes
    • fix: get parent node
    • code-style: remove "true" && "false" if return type is bool
    Open source →
  31. 3.1.3 06 Jan 2019
    Release notes
    • use new version of "voku/simple_html_dom"
    Open source →
  32. 3.1.2 28 Dec 2018

    Nothing published for this version

  33. 3.1.1 28 Dec 2018

    Nothing published for this version

  34. 3.1.0 27 Dec 2018
    Release notes
    • add "HtmlMinDomObserverInterface" (+ HtmlMin as Observable)
    • use phpcs fixer
    Open source →
  35. 3.0.6 01 Dec 2018
    Release notes
    • implement the "<nocompress>"-tag + tests
    Open source →
  36. 3.0.5 17 Oct 2018
    Release notes
    • update vendor (voku/simple_html_dom >= v4.1.7) + fix entities (<, >)
    Open source →
  37. 3.0.4 07 Oct 2018
    Release notes
    • update vendor (voku/simple_html_dom >= v4.1.6) + option for keep broken html
    Open source →
  38. 3.0.3 08 May 2018
    Release notes
    • update vendor (voku/simple_html_dom >= v4.1.4)
    Open source →
  39. 3.0.2 12 Feb 2018
    Release notes
    • fix regex for self-closing tags
    Open source →
  40. 3.0.1 29 Dec 2017
    Release notes
    • update vendor (voku/simple_html_dom >= v4.1.3)
    Open source →
  41. 3.0.0 22 Dec 2017
    Release notes
    • remove "Portable UTF-8" as required dependency

    -> this is a breaking change, without any API changes

    Open source →
  42. 2.0.4 22 Dec 2017
    Release notes
    • check if there was already whitespace e.g. from the content
    Open source →
  43. 2.0.3 22 Dec 2017
    Release notes
    • fix "Minifier removes spaces between tags"
    • fix "Multiple horizontal whitespace characters not collapsed"
    Open source →
  44. 2.0.2 10 Dec 2017
    Release notes
    • try to fix "Minifier removes spaces between tags" v2
    • disable "doRemoveWhitespaceAroundTags" by default
    Open source →
  45. 2.0.1 10 Dec 2017
    Release notes
    • try to fix "Minifier removes spaces between tags" v1
    Open source →
  46. 2.0.0 03 Dec 2017
    Release notes
    • drop support for PHP < 7.0
    • use "strict_types"
    • doRemoveOmittedQuotes() -> remove quotes e.g. class="lall" => class=lall
    • doRemoveOmittedHtmlTags() -> remove ommitted html tags e.g. <p>lall</p> => <p>lall
    Open source →
  47. 1.0.9 22 Sep 2017

    Nothing published for this version

  48. 1.0.8 09 Sep 2017

    Nothing published for this version

  49. 1.0.7 09 Sep 2017

    Nothing published for this version

  50. 1.0.6 09 Sep 2017

    Nothing published for this version

  51. 1.0.5 12 May 2017

    Nothing published for this version

  52. 1.0.4 18 Mar 2017

    Nothing published for this version

  53. 1.0.3 07 Dec 2016

    Nothing published for this version

  54. 1.0.2 01 Dec 2016

    Nothing published for this version

  55. 1.0.1 01 Dec 2016

    Nothing published for this version

  56. 1.0.0 30 Nov 2016

    Nothing published for this version

  57. 0.0.7 23 Oct 2016

    Nothing published for this version

  58. 0.0.6 23 Oct 2016

    Nothing published for this version

  59. 0.0.5 17 Oct 2016

    Nothing published for this version

  60. 0.0.4 no date

    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