chore(deps): update dependency akankov/html-min to v2.11.0 - #4
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update dependency akankov/html-min to v2.11.0#4renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/akankov-html-min-2.x-lockfile
branch
from
May 29, 2026 17:27
3c128e7 to
5381c14
Compare
renovate
Bot
force-pushed
the
renovate/akankov-html-min-2.x-lockfile
branch
from
May 31, 2026 02:29
5381c14 to
6d312b3
Compare
renovate
Bot
force-pushed
the
renovate/akankov-html-min-2.x-lockfile
branch
from
May 31, 2026 17:58
6d312b3 to
86a3138
Compare
renovate
Bot
force-pushed
the
renovate/akankov-html-min-2.x-lockfile
branch
from
July 26, 2026 02:27
86a3138 to
c118a13
Compare
renovate
Bot
force-pushed
the
renovate/akankov-html-min-2.x-lockfile
branch
from
August 7, 2026 03:47
c118a13 to
c6038b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.5.1→2.11.0Release Notes
akankov/html-min (akankov/html-min)
v2.11.0Compare Source
Hardening release: a re-entrancy guard on the shared parser state and a
CPU-exhaustion cap on the opt-in
keepBrokenHtmlmode, plus supply-chaintooling. The
MinifierOptionsconstructor surface is unchanged and normalminification is unaffected.
Added
Internal\HtmlParserkeeps per-run placeholder statein static fields shared by every
HtmlMininstance in the process. A nestedminify()— e.g. from asetInlineCssMinifier()/setInlineJsMinifier()callback or a DOM observer — would reset that state mid-run and leave
placeholder tokens in the output. Nesting now throws a
LogicException, andthe lock is released in a
finallyso a throwing callback cannot wedge apersistent worker (Octane / RoadRunner / Swoole). The misleading "static/pure"
docblock is corrected accordingly.
a 7-day new-release cooldown) and a non-blocking
composer auditCI job.Security
keepBrokenHtml. The broken-HTML rewrite issuper-linear in input size, so large input could burn seconds of CPU. Input
over 128 KB now skips the rewrite — the document is still minified, just
without broken-HTML preservation — and logs a warning when a logger is
attached.
useKeepBrokenHtml()is now documented as trusted-input-only.v2.10.0Compare Source
Presets, a WHATWG omission audit, and docs. Default output gets a little
smaller (more optional end tags dropped) and a little more correct (structural
end tags are kept in front of preserved comments). No API breakage; the
MinifierOptionsconstructor surface is unchanged.Added
MinifierOptionspresets.MinifierOptions::aggressive()(maximumspec-valid byte savings: block-tag whitespace trimming, whitespace-only
text-node removal, start-tag omission, spec-default attribute removal,
inline CSS/JS minification — URL scheme stripping deliberately stays off)
and
MinifierOptions::conservative()(shape-preserving: keeps optionalend tags, attribute quotes, attribute/class order, and empty attributes;
only collapses whitespace, strips comments, and drops deprecated
attributes). Both sit alongside the existing
defaults(); a new README"Presets" section documents the trade-offs. The constructor surface is
unchanged, so binding config keys are unaffected.
removeOmittedHtmlTagsnow also drops
</option>/</optgroup>before an<hr>(the<select>separator addition),
</rt>(previously onlyrpwas handled; samefollowed-by-
rt/rp-or-end rule), and</p>before the post-HTML4 blockelements the spec lists (
details,dialog,figcaption,figure,main,search). Smaller output; meaning unchanged.mimics the real nonce-bearing placeholder format round-trips verbatim, and
the nonce itself is pinned: 10 lowercase hex chars, stable within a run,
fresh on every
HtmlParser::reset().Fixed
html/head/bodyend tags are no longer omitted before a comment.Per WHATWG §13.1.2.4, omitting them there would pull the (preserved or
conditional) comment inside the element on reparse — a real DOM change.
Deliberate, documented deviation: the spec also blocks
headomissionbefore ASCII whitespace, but the reparse difference is a rendering-
irrelevant whitespace node, and honoring it would keep
</head>onvirtually every real-world page — so whitespace does not block.
Mutation-testing droppings in the repo root.
CliTestnow runs eachtest from a scratch directory under the system temp dir. Under Infection,
the
TrueValuemutator on the--output=str_starts_with()check turnedan input path
/tmp/htmlminXYZinto a CWD-relativeminXYZviasubstr($arg, 9), so everymake infectionrun left a 0-bytemin*filein the repository root. The mutant was killed either way; the side effect
now lands in the scratch dir instead. The
/min*.gitignoreentry thatpapered over this is gone.
v2.9.0Compare Source
Completes the HTML5 tag-omission rule set and finishes decomposing the
minifier core. Default output gets a little smaller (more optional end tags
dropped); the more aggressive start-tag omission is opt-in. No API breakage.
Added
removeOmittedHtmlTagsnow also drops theend tags of
<thead>(when followed by<tbody>/<tfoot>),<tbody>and<tfoot>(per the spec's "followed by / end of section" rules), and<caption>/<colgroup>(unless immediately followed by ASCII whitespace or acomment). Smaller table markup; well-formed output is unchanged in meaning.
<html>/<head>/<body>start-tag omission. NewremoveOmittedHtmlStartTagsoption (MinifierOptions/doRemoveOmittedHtmlStartTags()), off by default, also omits thestructural start tags where the HTML5 spec allows (never when the element
has attributes). It is deliberately opt-in: far more aggressive than end-tag
omission and, on an effectively-empty document, can reduce output to an empty
string. Existing output is unchanged unless you enable it.
Changed
ProtectedContentManagerextraction. The protected-contentmachinery (
<nocompress>/<code>subtrees, inline<script>/<style>bodies, conditional / special comments) and its state — the saved-node map,
counter, and placeholder token — move out of
HtmlMininto a dedicatedInternal\ProtectedContentManager.HtmlMindrops ~165 lines (1218 → 1053).No behaviour or API change.
OptionalTagOmissionrule-dispatch refactor. The ~280-lineconditional end-tag boolean is replaced by a per-tag dispatch with small,
independently-readable rule helpers. No behaviour change — the per-tag truth
table (quirks included, e.g.
dtgrouped withdd) is locked by newcharacterization tests in
OptionalTagOmissionTest.v2.8.1Compare Source
Internal hardening of the libxml entity-preserving placeholder layer. No change
to public API or to the minified output of any input.
Changed
HtmlParser::reset()now regenerates therandom placeholder nonce (and every cache derived from it) at the start of each
minify() run instead of reusing one nonce for the whole process. This keeps the
unguessable tokens from being reused across calls — defence-in-depth for
long-lived / worker runtimes (Swoole, FrankenPHP, ReactPHP). All five
nonce-derived caches are cleared together so masking and restoration never
mismatch.
HtmlParser::$brokenHtmlMapis now private. It waspublic staticbut isonly used internally; encapsulating it prevents external code from corrupting
the cross-call replacement table.
v2.8.0Compare Source
Test-effectiveness and parser-cleanup release. Mutation score is raised to
77.4% (line coverage stays 100%) by pinning the scoping of the
attribute-removal rules, and a redundant
</html>-trim preprocessing step isremoved from the parser. The version is a minor bump rather than a patch
because that cleanup changes observable output for one class of malformed
input (multiple
</html>markers) — well-formed documents are unaffected.Released from PRs
#35–#36.
Changed
tests that pin the scoping of the deprecated/default-attribute removals —
e.g.
type=text/cssis stripped only onrel=stylesheetlinks (notrel=preload), andvalue=""only on<input type=text>(not other inputtypes). The Infection floor is ratcheted 74 → 75 to match (a ~1.75pp buffer is
kept for timeout jitter). Audit note: the bulk of the remaining surviving
mutants are genuinely equivalent — internal cache keys, performance
short-circuits,
(string)casts that never seenull, and regex changes madeunreachable by upstream
stripos()guards — so they are intentionally notchased. No public API or runtime behaviour change.
</html>-trim preprocessing step inHtmlParser::parse().libxml already pulls content after a closing
</html>back into the body, sothe explicit regex +
str_replacewas a no-op for every well-formed andsingle-
</html>input (verified byte-identical on PHP 8.3/8.4/8.5). The onlyobservable difference is on pathological input with multiple
</html>markers (
</html>mid</html>end), which now flattens to a single paragraph(
<p>midend) instead of two — both are arbitrary handling of malformed HTML;the new behaviour is pinned by a characterization test. This also deletes a
cluster of equivalent mutants and a confusing regex. (The sibling
pre-
<!DOCTYPE>junk strip was investigated too and is not redundant —libxml keeps element junk before the doctype — so it stays.)
v2.7.1Compare Source
Test-hardening and robustness release. The library test suite now covers 100%
of lines (up from ~93%) with the CI floors ratcheted to match, and two small
warning-suppression / dead-guard touches fell out of the coverage work. No
public API or runtime behaviour change. Released from PRs
#31–#33.
Changed
HtmlParser::findAll()no longer leaks a PHP warning for an unsupportedselector (e.g. a CSS class like
.foo, which has no XPath translation). Themalformed-query case already returned an empty array; the raw
DOMXPathwarning is now suppressed so it stays a clean empty result.
Cli::readInput()now relies on a single@file_get_contents()(which already reports missing / unreadable / directorypaths via
false) instead of a redundantis_file()/is_readable()pre-check. Behaviour is unchanged — same stderr message and exit code 1 on
failure. Raw PHP warnings on I/O failure are suppressed (the clean stderr line
is the signal).
last few percent surfaced two small robustness touches (the
findAll()warning suppression and the
Cliread simplification above) and severaldefensive-guard simplifications; remaining unreachable type-guards were
restructured rather than ignored. The CI floors are ratcheted to match:
MIN_LINE_COVERAGE90 → 100, and the Infection MSI / Covered-MSI floors72 → 74. No public API or runtime behaviour change.
v2.7.0Compare Source
Extensibility and internal-architecture release. Every library class is now open
for subclassing, and the ~2,000-line
HtmlMingod class is decomposed into fivefocused
Internalcollaborators — all behaviour-preserving, no public APIchange. Also fixes an adversarial-input placeholder collision and adds a
test-effectiveness toolchain (line-coverage gate + Infection mutation testing,
with Codecov and Stryker badges). Released from PRs
#24–#29.
Fixed
corrupts output. The parser masks libxml-hostile characters (
&|+%@[]{})with placeholder tokens and reverses them after serialization; caller content
that literally contained a token (e.g.
____HTMLMIN_AMP____) was rewritten bythe restore pass (→
&). Placeholders now embed a per-process random nonce,so input cannot collide with them. Internal — entity/AMP/template round-trips
are unchanged; only the obscure collision case is fixed.
Changed
final. Every class is now open forextension (
finaland thefinal readonly classform are removed throughout),since consumers of a library legitimately need to subclass. Value objects
(
MinifierOptions,Cli,MinifierMiddleware,DomSerializer) keepproperty-level
readonly— they stay immutable but are freelysubclassable (unlike a
readonly class, which only accepts readonlysubclasses). Rector's
ReadOnlyClassRectoris disabled to preserve this.HtmlMingod class (2,023 → 1,220 lines so far), inbehaviour-preserving slices:
domNodeClosingTagOptional()plus its tag lists and memo cache →
Internal\OptionalTagOmission.domNodeToString()/ attribute-stringbuilding / whitespace helpers →
Internal\DomSerializer, which reads itsflags through the existing
HtmlMinInterfaceconfig contract.<style>/<script>coordination,pluggable-override storage, and bundled-minifier fallback →
Internal\InlineContentMinifier.removeWhitespaceAroundTags()/sumUpWhitespace()and their tag tables →Internal\WhitespaceNormalizer(config-free static transforms; the toggles still gate them at the call site).
getDoctype()→Internal\Doctype::serialize(),sitting next to the
Internal\DoctypeKindclassifier.The protected
getNextSiblingOfTypeDOMElement()anddomNodeToString()arekept as delegating shims so existing subclasses do not break. Internal — no
public surface change.
floor, enforced via
bin/coverage-check.php) and mutation testing withInfection (MSI floor). Both run in
make ciand a new CI job, backed by apcov Docker image (
docker/coverage.Dockerfile). Dev-only — no change to thepublished package or its runtime dependencies.
characterization tests for the CSS/JS scanners (comment separation,
url(lookahead, regex-vs-division at each character boundary, template
interpolation). Test-only — no runtime behaviour change.
complement of the default-attribute rules — near-misses (wrong value, or the
right attribute on the wrong tag) that must be kept — plus the media/
typeCSS-default removals, pinning every rule's
tag && attr && valueconjunction.Test-only — no runtime behaviour change.
if ($tag === … && $attrName === … && $attrValue === …)blocks inOptimizeAttributeswith two declarative lookup tables. Behaviour isidentical (guarded by the rule matrix above); ~50 lines of branching become a
table plus two lookups. The mutation floor moves to 72% MSI — collapsing the
if-chain removes ~90 thoroughly-killed mutants, which mechanically lowers the
score even though the code is simpler. Internal — no public surface change.
MSI to the Stryker Mutator dashboard; the README shows both badges. Reporting
only — gated behind repository secrets and a no-op without them.
v2.6.1Compare Source
Bug-fix release hardening the v2.6.0 bundled inline minifiers against three
edge cases that could corrupt output. All three are narrow but real; the
default-off toggles mean only opted-in callers were affected.
Fixed
;}inside a string is no longer mangled. Thetrailing-semicolon optimisation ran as a blanket
str_replace(';}', '}')over the whole output, reaching into verbatim-preserved strings — e.g.
content:"x;}y"becamecontent:"x}y". The;is now deferred and droppedonly when it is genuinely structural (immediately before
})./after a postfix++/--is treated as division, not aregex.
a++ / bwas scanned as a regex literal, swallowing the rest of theline and suppressing whitespace collapse.
a + /re/remains a regex.${…}interpolation no longer break template scanning. A construct like
`${ obj["}"] }`previously miscounted interpolation depth, missed theclosing backtick, and ran past the template. Strings and nested templates are
now skipped while counting interpolation braces.
v2.6.0Compare Source
Inline CSS and JS minification lands as an opt-in feature. The contents of
inline
<style>and<script>blocks — previously passed through untouched —can now be minified by bundled, zero-dependency, conservative minifiers, with
pluggable backends for aggressive tools. Both toggles default to off, so
existing output is unchanged. Released from PR
#17.
Added
contents of inline
<style>and<script>blocks, which previouslyround-tripped untouched:
HtmlMin::doMinifyInlineCss(bool $on = true)— strips CSS comments andcollapses whitespace. String and
url(...)contents are preserved.HtmlMin::doMinifyInlineJs(bool $on = true)— conservative, ASI-safeminification: removes comments and collapses horizontal whitespace while
preserving newlines, strings, regex literals, and template literals.
<script>elements whosetypeis not a JavaScript type (e.g.application/ld+json,text/x-template) pass through untouched, as do<script src="...">references.HtmlMin::setInlineCssMinifier(?callable)and
HtmlMin::setInlineJsMinifier(?callable)replace the bundled minifierswith any
callable(string): string(e.g. wrapmatthiasmullie/minifyorshell out to
terser). Passnullto restore the bundled default. A buggybundled minifier is logged via the PSR-3 logger and falls back to the
original source so the page is never corrupted.
MinifierOptionsgainsminifyInlineCssandminifyInlineJsfields(both default
false).--minify-inline-cssand--minify-inline-js.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.