minify-html/rust/onepass/README.md

30 lines
1.6 KiB
Markdown
Raw Normal View History

2021-08-09 04:10:52 -04:00
# minify-html-onepass
An HTML minifier that provides the functionality of [minify-html](https://github.com/wilsonzlin/minify-html) with much more performance, but with stricter parsing and less configurability.
- Uses the same advanced minification strategy.
- Minifies in one pass with zero memory allocations.
- Outputs in place; no copy or buffer required.
## Performance
2021-11-12 01:24:06 -05:00
<img width="600" alt="Chart showing speed of HTML minifiers" src="https://wilsonl.in/minify-html/bench/0.7.0/core/average-speeds.png">
2021-08-09 04:10:52 -04:00
## Usage
The API is different compared to minify-html; refer to per-package documentation for more details.
- <img width="24" src="https://wilsonl.in/minify-html/icon/java.png"> [in.wilsonl.minifyhtmlonepass](https://search.maven.org/artifact/in.wilsonl.minifyhtmlonepass/minify-html-onepass)
- <img width="24" src="https://wilsonl.in/minify-html/icon/nodejs.png"> [@minify-html/onepass](https://www.npmjs.com/package/@minify-html/onepass)
- <img width="24" src="https://wilsonl.in/minify-html/icon/python.png"> [minify-html-onepass](https://pypi.org/project/minify-html-onepass)
- <img width="24" src="https://wilsonl.in/minify-html/icon/ruby.png"> [minify_html_onepass](https://rubygems.org/gems/minify_html_onepass)
- <img width="24" src="https://wilsonl.in/minify-html/icon/rust.png"> [minify-html-onepass](https://crates.io/crates/minify-html-onepass)
## Parsing
In addition to the [minify-html rules](https://github.com/wilsonzlin/minify-html/blob/master/notes/Parsing.md), the onepass variant has additional requirements:
- Opening tags must not be omitted.
- Invalid closing tags are not allowed.
2021-08-10 00:27:38 -04:00
- The document cannot end unexpectedly.