htmlnano 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
 
6
+ ## [0.2.4] - 2019-07-11
7
+ ## Fixed
8
+ - Remove crossorigin from boolean attribute [#78], [#79].
9
+ - Disable SVGO plugin convertShapeToPath in safe preset [#76].
10
+
11
+
6
12
  ## [0.2.3] - 2019-02-14
7
13
  ## Fixed
8
14
  - Keep `<g>` in SVG by default [#71].
@@ -116,7 +122,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
116
122
 
117
123
 
118
124
 
119
- [0.2.3]: https://github.com/posthtml/htmlnano/compare/0.2.1...0.2.3
125
+ [0.2.4]: https://github.com/posthtml/htmlnano/compare/0.2.3...0.2.4
126
+ [0.2.3]: https://github.com/posthtml/htmlnano/compare/0.2.2...0.2.3
120
127
  [0.2.2]: https://github.com/posthtml/htmlnano/compare/0.2.1...0.2.2
121
128
  [0.2.1]: https://github.com/posthtml/htmlnano/compare/0.2.0...0.2.1
122
129
  [0.2.0]: https://github.com/posthtml/htmlnano/compare/0.1.10...0.2.0
@@ -132,7 +139,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
132
139
  [0.1.1]: https://github.com/posthtml/htmlnano/compare/0.1.0...0.1.1
133
140
 
134
141
 
135
- [#71]: https://github.com/posthtml/htmlnano/issues/67
142
+ [#79]: https://github.com/posthtml/htmlnano/issues/79
143
+ [#78]: https://github.com/posthtml/htmlnano/issues/78
144
+ [#76]: https://github.com/posthtml/htmlnano/issues/76
145
+ [#71]: https://github.com/posthtml/htmlnano/issues/71
136
146
  [#67]: https://github.com/posthtml/htmlnano/issues/67
137
147
  [#66]: https://github.com/posthtml/htmlnano/issues/66
138
148
  [#65]: https://github.com/posthtml/htmlnano/issues/65
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  Modular HTML minifier, built on top of the [PostHTML](https://github.com/posthtml/posthtml). Inspired by [cssnano](http://cssnano.co/).
6
6
 
7
+ > The author of htmlnano is available for hire as a full stack web developer: https://kirillmaltsev.net/services
7
8
 
8
9
 
9
10
  ## [Benchmark](https://github.com/maltsev/html-minifiers-benchmark/blob/master/README.md)
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = collapseBooleanAttributes;
7
7
  // Source: https://github.com/kangax/html-minifier/issues/63
8
- var htmlBooleanAttributes = new Set(['allowfullscreen', 'allowpaymentrequest', 'allowtransparency', 'async', 'autofocus', 'autoplay', 'checked', 'compact', 'controls', 'crossorigin', 'declare', 'default', 'defaultchecked', 'defaultmuted', 'defaultselected', 'defer', 'disabled', 'enabled', 'formnovalidate', 'hidden', 'indeterminate', 'inert', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nohref', 'noresize', 'noshade', 'novalidate', 'nowrap', 'open', 'pauseonexit', 'readonly', 'required', 'reversed', 'scoped', 'seamless', 'selected', 'sortable', 'truespeed', 'typemustmatch', 'visible']);
8
+ var htmlBooleanAttributes = new Set(['allowfullscreen', 'allowpaymentrequest', 'allowtransparency', 'async', 'autofocus', 'autoplay', 'checked', 'compact', 'controls', 'declare', 'default', 'defaultchecked', 'defaultmuted', 'defaultselected', 'defer', 'disabled', 'enabled', 'formnovalidate', 'hidden', 'indeterminate', 'inert', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nohref', 'noresize', 'noshade', 'novalidate', 'nowrap', 'open', 'pauseonexit', 'readonly', 'required', 'reversed', 'scoped', 'seamless', 'selected', 'sortable', 'truespeed', 'typemustmatch', 'visible']);
9
9
 
10
10
  var amphtmlBooleanAttributes = new Set(['⚡', 'amp', '⚡4ads', 'amp4ads', '⚡4email', 'amp4email', 'amp-custom', 'amp-boilerplate', 'amp4ads-boilerplate', 'amp4email-boilerplate', 'allow-blocked-ranges', 'amp-access-hide', 'amp-access-template', 'amp-keyframes', 'animate', 'arrows', 'data-block-on-consent', 'data-enable-refresh', 'data-multi-size', 'date-template', 'disable-double-tap', 'disable-session-states', 'disableremoteplayback', 'dots', 'expand-single-section', 'expanded', 'fallback', 'first', 'fullscreen', 'inline', 'lightbox', 'noaudio', 'noautoplay', 'noloading', 'once', 'open-after-clear', 'open-after-select', 'open-button', 'placeholder', 'preload', 'reset-on-refresh', 'reset-on-resize', 'resizable', 'rotate-to-fullscreen', 'second', 'standalone', 'stereo', 'submit-error', 'submit-success', 'submitting', 'subscriptions-actions', 'subscriptions-dialog']);
11
11
 
@@ -23,7 +23,7 @@ exports.default = {
23
23
  minifyJs: {},
24
24
  minifyJson: {},
25
25
  minifySvg: {
26
- plugins: [{ collapseGroups: false }]
26
+ plugins: [{ collapseGroups: false }, { convertShapeToPath: false }]
27
27
  },
28
28
  removeEmptyAttributes: true,
29
29
  removeRedundantAttributes: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htmlnano",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Modular HTML minifier, built on top of the PostHTML",
5
5
  "main": "index.js",
6
6
  "author": "Kirill Maltsev <maltsevkirill@gmail.com>",
@@ -15,8 +15,8 @@
15
15
  "release:patch": "release-it patch -n"
16
16
  },
17
17
  "release-it": {
18
- "scripts": {
19
- "beforeStart": "npm test"
18
+ "hooks": {
19
+ "before:init": "npm test"
20
20
  }
21
21
  },
22
22
  "keywords": [
@@ -32,24 +32,24 @@
32
32
  ]
33
33
  },
34
34
  "dependencies": {
35
- "cssnano": "^4.1.9",
36
- "normalize-html-whitespace": "^0.2.0",
35
+ "cssnano": "^4.1.10",
36
+ "normalize-html-whitespace": "^1.0.0",
37
37
  "object-assign": "^4.0.1",
38
- "posthtml": "^0.11.3",
39
- "posthtml-render": "^1.1.4",
40
- "svgo": "^1.0.5",
41
- "terser": "^3.16.1",
42
- "uncss": "^0.16.2"
38
+ "posthtml": "^0.11.4",
39
+ "posthtml-render": "^1.1.5",
40
+ "svgo": "^1.2.2",
41
+ "terser": "^4.1.2",
42
+ "uncss": "^0.17.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "babel-cli": "^6.26.0",
46
46
  "babel-core": "^6.26.3",
47
- "babel-eslint": "^10.0.0",
47
+ "babel-eslint": "^10.0.2",
48
48
  "babel-preset-env": "^1.7.0",
49
- "eslint": "^5.13.0",
50
- "expect": "^24.0.0",
51
- "mocha": "^5.2.0",
52
- "release-it": "^10.0.0",
49
+ "eslint": "^6.0.1",
50
+ "expect": "^24.8.0",
51
+ "mocha": "^6.1.0",
52
+ "release-it": "^12.3.3",
53
53
  "rimraf": "^2.6.3"
54
54
  },
55
55
  "repository": {
package/test.js CHANGED
@@ -2,16 +2,12 @@ const htmlnano = require('./index');
2
2
  const fs = require('fs');
3
3
  const safePreset = require('./lib/presets/safe').default;
4
4
 
5
- const options = {
6
- minifySvg: safePreset.minifySvg,
7
- };
5
+ const options = {};
8
6
 
9
- console.log(options);
10
-
11
- const svg = fs.readFileSync('./orig.html', 'utf8');
7
+ const html = fs.readFileSync('./test.html', 'utf8');
12
8
 
13
9
  htmlnano
14
- .process(svg, options, {})
10
+ .process(html, options)
15
11
  .then(function (result) {
16
12
  console.log(result.html);
17
13
  })