You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,13 @@ As of version 2.0.0, all notable changes to HTML Minifier Next (HMN) are documen
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
+
## [5.0.3] - 2026-02-04
8
+
9
+
### Fixed
10
+
11
+
* Fixed empty elements with `id` attributes being incorrectly removed when `removeEmptyElements` was enabled (elements with IDs must be preserved as they serve as navigation targets, JavaScript selectors, and accessibility landmarks)
12
+
* Fixed duplicate attributes being preserved in output (per HTML spec, when an attribute appears multiple times, [only the first occurrence is kept](https://html.spec.whatwg.org/multipage/parsing.html#attribute-name-state); duplicates are now removed during minification)
Copy file name to clipboardExpand all lines: README.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -403,38 +403,38 @@ How does HTML Minifier Next compare to other minifiers? (All minification with t
403
403
| Site | Original Size (KB) | [HTML Minifier Next](https://github.com/j9t/html-minifier-next) ([config](https://github.com/j9t/html-minifier-next/blob/main/benchmarks/html-minifier.json))<br>[](https://socket.dev/npm/package/html-minifier-next) | [htmlnano](https://github.com/posthtml/htmlnano)<br>[](https://socket.dev/npm/package/htmlnano) | [@swc/html](https://github.com/swc-project/swc)<br>[](https://socket.dev/npm/package/@swc/html) | [minify-html](https://github.com/wilsonzlin/minify-html)<br>[](https://socket.dev/npm/package/@minify-html/node) | [minimize](https://github.com/Swaagie/minimize)<br>[](https://socket.dev/npm/package/minimize) | [htmlcompressor.com](https://htmlcompressor.com/) |
|**Average processing time**||77 ms (30/30) |149 ms (29/30) |49 ms (30/30) |**17 ms (30/30)**|330 ms (30/30) |1513 ms (24/30) |
435
+
|**Average processing time**||83 ms (30/30) |165 ms (29/30) |47 ms (30/30) |**13 ms (30/30)**|283 ms (30/30) |1254 ms (24/30) |
436
436
437
-
(Last updated: Feb 3, 2026)
437
+
(Last updated: Feb 4, 2026)
438
438
<!-- End auto-generated -->
439
439
440
440
Notes: Minimize does not minify CSS and JS. [HTML Minifier Terser](https://github.com/terser/html-minifier-terser) is currently not included due to issues around whitespace collapsing and removal of code using modern CSS features, issues which appeared to distort the data.
0 commit comments