Skip to content

Commit 4df008a

Browse files
committed
Release 1.1.0
1 parent 5fcd3a0 commit 4df008a

File tree

10 files changed

+100
-7
lines changed

10 files changed

+100
-7
lines changed

CHANGELOG.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55

6+
## [1.1.0] - 2021-09-19
7+
### Added
8+
- Collapse missing value default attribute in `removeRedundantAttributes` [#158].
9+
- New `normalizeAttributeValues` module to normalize casing of attribute values [#163].
10+
- Custom matcher for `removeComments` [#156].
11+
12+
### Changed
13+
- Remove more empty attributes in `removeEmptyAttributes` [#161].
14+
- Enhance collapse whitespace in `collapseWhitespace` [#145].
15+
- `minifyJs` and `minifyUrls` enhancement [#159].
16+
- Enhance attribute collapse whitespace in `collapseAttributeWhitespace` [#157].
17+
18+
19+
620
## [1.0.1] - 2021-09-11
721
### Added
822
- Support of [@novaatwarren/uncss](https://github.com/novaatwarren/uncss) fork [#154]
@@ -205,6 +219,7 @@ Otherwise, you have to adapt the config according to the new [PurgeCSS@3](https:
205219
- Remove attributes that contains only white spaces.
206220

207221

222+
[1.1.0]: https://github.com/posthtml/htmlnano/compare/1.0.1...1.1.0
208223
[1.0.1]: https://github.com/posthtml/htmlnano/compare/1.0.0...1.0.1
209224
[1.0.0]: https://github.com/posthtml/htmlnano/compare/0.2.9...1.0.0
210225
[0.2.9]: https://github.com/posthtml/htmlnano/compare/0.2.8...0.2.9
@@ -228,8 +243,15 @@ Otherwise, you have to adapt the config according to the new [PurgeCSS@3](https:
228243
[0.1.2]: https://github.com/posthtml/htmlnano/compare/0.1.1...0.1.2
229244
[0.1.1]: https://github.com/posthtml/htmlnano/compare/0.1.0...0.1.1
230245

246+
[#163]: https://github.com/posthtml/htmlnano/issues/163
247+
[#161]: https://github.com/posthtml/htmlnano/issues/161
248+
[#159]: https://github.com/posthtml/htmlnano/issues/159
249+
[#158]: https://github.com/posthtml/htmlnano/issues/158
250+
[#157]: https://github.com/posthtml/htmlnano/issues/157
251+
[#156]: https://github.com/posthtml/htmlnano/issues/156
231252
[#154]: https://github.com/posthtml/htmlnano/issues/154
232253
[#153]: https://github.com/posthtml/htmlnano/issues/153
254+
[#145]: https://github.com/posthtml/htmlnano/issues/145
233255
[#135]: https://github.com/posthtml/htmlnano/issues/135
234256
[#129]: https://github.com/posthtml/htmlnano/issues/129
235257
[#125]: https://github.com/posthtml/htmlnano/issues/125
@@ -243,10 +265,10 @@ Otherwise, you have to adapt the config according to the new [PurgeCSS@3](https:
243265
[#112]: https://github.com/posthtml/htmlnano/issues/112
244266
[#111]: https://github.com/posthtml/htmlnano/issues/111
245267
[#110]: https://github.com/posthtml/htmlnano/issues/110
246-
[#107]: https://github.com/posthtml/htmlnano/issues/107
247268
[#108]: https://github.com/posthtml/htmlnano/issues/108
248-
[#102]: https://github.com/posthtml/htmlnano/issues/102
269+
[#107]: https://github.com/posthtml/htmlnano/issues/107
249270
[#104]: https://github.com/posthtml/htmlnano/issues/104
271+
[#102]: https://github.com/posthtml/htmlnano/issues/102
250272
[#98]: https://github.com/posthtml/htmlnano/issues/98
251273
[#95]: https://github.com/posthtml/htmlnano/issues/95
252274
[#94]: https://github.com/posthtml/htmlnano/issues/94

docs/versioned_docs/version-1.0.1/050-modules.md renamed to docs/versioned_docs/version-1.1.0/050-modules.md

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Collapse redundant white spaces in list-like attributes (`class`, `rel`, `ping`)
1010
#### Example
1111
Source:
1212
```html
13-
<div class=" content page "></div>
13+
<a class=" content page " style=" display: block; " href=" https://example.com"></a>
1414
```
1515

1616
Minified:
1717
```html
18-
<div class="content page"></div>
18+
<a class="content page" style="display: block;" href="https://example.com"></a>
1919
```
2020

2121

@@ -80,18 +80,68 @@ Minified:
8080
#### Options
8181
- `safe` – removes all HTML comments except the conditional comments and [`<!--noindex--><!--/noindex-->`](https://yandex.com/support/webmaster/controlling-robot/html.xml) (default)
8282
- `all` — removes all HTML comments
83+
- A `RegExp` — only HTML comments matching the given regexp will be removed.
84+
- A `Function` that returns boolean — removes HTML comments that can make the given callback function returns truthy value.
8385

8486
#### Example
87+
8588
Source:
89+
90+
```js
91+
{
92+
removeComments: 'all'
93+
}
94+
```
95+
8696
```html
8797
<div><!-- test --></div>
8898
```
8999

90100
Minified:
101+
91102
```html
92103
<div></div>
93104
```
94105

106+
Source:
107+
108+
```js
109+
{
110+
removeComments: /<!--(\/)?noindex-->/
111+
}
112+
```
113+
114+
```html
115+
<div><!--noindex-->this text will not be indexed<!--/noindex-->Lorem ipsum dolor sit amet<!--more-->Lorem ipsum dolor sit amet</div>
116+
```
117+
118+
Minified:
119+
120+
```html
121+
<div>this text will not be indexedLorem ipsum dolor sit amet<!--more-->Lorem ipsum dolor sit amet</div>
122+
```
123+
124+
Source:
125+
126+
```js
127+
{
128+
removeComments: (comments) => {
129+
if (comments.includes('noindex')) return true;
130+
return false;
131+
}
132+
}
133+
```
134+
135+
```html
136+
<div><!--noindex-->this text will not be indexed<!--/noindex-->Lorem ipsum dolor sit amet<!--more-->Lorem ipsum dolor sit amet</div>
137+
```
138+
139+
Minified:
140+
141+
```html
142+
<div>this text will not be indexedLorem ipsum dolor sit amet<!--more-->Lorem ipsum dolor sit amet</div>
143+
```
144+
95145

96146
### removeEmptyAttributes
97147
Removes empty [safe-to-remove](https://github.com/posthtml/htmlnano/blob/master/lib/modules/removeEmptyAttributes.es6) attributes.
@@ -713,3 +763,24 @@ Due to [the limitation of PostHTML](https://github.com/posthtml/htmlnano/issues/
713763
- `body`
714764
- `colgroup`
715765
- `tbody`
766+
767+
### normalizeAttributeValues
768+
769+
Normalize casing of attribute values.
770+
771+
The module won't impact the plain-text size of the output. However it will improve the compression ratio of gzip/brotli used in HTTP compression.
772+
773+
#### Example
774+
775+
Source:
776+
777+
```html
778+
<form method="GET"></form>
779+
```
780+
781+
Minified:
782+
783+
```html
784+
<form method="get"></form>
785+
```
786+

docs/versioned_sidebars/version-1.0.1-sidebars.json renamed to docs/versioned_sidebars/version-1.1.0-sidebars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version-1.0.1/tutorialSidebar": [
2+
"version-1.1.0/tutorialSidebar": [
33
{
44
"type": "autogenerated",
55
"dirName": "."

docs/versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[
2-
"1.0.1"
2+
"1.1.0"
33
]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "htmlnano",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"description": "Modular HTML minifier, built on top of the PostHTML",
55
"main": "index.js",
66
"author": "Kirill Maltsev <[email protected]>",

0 commit comments

Comments
 (0)