From 4ca0fbdf852b7ac8a3658047b728b9728f15a666 Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Tue, 5 Apr 2016 01:28:17 +0800 Subject: [PATCH] clarify what sorting aims to achieve --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8677f87..21d4579 100644 --- a/README.md +++ b/README.md @@ -70,10 +70,14 @@ How does HTMLMinifier compare to other solutions — [HTML Minifier from Will Pe | `removeScriptTypeAttributes` | Remove `type="text/javascript"` from `script` tags. Other `type` attribute values are left intact | `false` | | `removeStyleLinkTypeAttributes`| Remove `type="text/css"` from `style` and `link` tags. Other `type` attribute values are left intact | `false` | | `removeTagWhitespace` | Remove space between attributes whenever possible. **Note that this will result in invalid HTML!** | `false` | -| `sortAttributes` | Sort attributes by frequency | `false` | -| `sortClassName` | Sort style classes by frequency | `false` | +| `sortAttributes` | [Sort attributes by frequency](#sorting-attributes--style-classes) | `false` | +| `sortClassName` | [Sort style classes by frequency](#sorting-attributes--style-classes) | `false` | | `useShortDoctype` | [Replaces the `doctype` with the short (HTML5) doctype](http://perfectionkills.com/experimenting-with-html-minifier/#use_short_doctype) | `false` | +### Sorting attributes / style classes + +Minifier options like `sortAttributes` and `sortClassName` won't impact the plain-text size of the output. However, they form long repetitive chains of characters that should improve compression ratio of gzip used in HTTP compression. + ## Special cases ### Ignoring chunks of markup -- 2.34.1