Permalink
Browse files

remove lint functionalities

link to HTMLLint project in README.md
fixes #80
  • Loading branch information...
1 parent 4bc5f5f commit 22d134003df20d02c479edfb42fd931c6a21d608 @alexlamsl alexlamsl committed Apr 16, 2016
Showing with 6,830 additions and 7,346 deletions.
  1. +0 −6 Gruntfile.js
  2. +3 −2 README.md
  3. +0 −3 assets/master.css
  4. +0 −15 assets/master.js
  5. +0 −8 cli.js
  6. +6,809 −6,979 dist/htmlminifier.js
  7. +13 −13 dist/htmlminifier.min.js
  8. +0 −10 index.html
  9. +4 −2 package.json
  10. +0 −1 sample-cli-config-file.conf
  11. +0 −177 src/htmllint.js
  12. +1 −17 src/htmlminifier.js
  13. +0 −1 test.js
  14. +0 −15 tests/lint-tests.html
  15. +0 −97 tests/lint.js
View
@@ -31,7 +31,6 @@ module.exports = function(grunt) {
options: {
banner: '<%= banner %>',
require: [
- './src/htmllint.js:html-minifier/src/htmllint',
'./src/htmlminifier.js:html-minifier'
]
},
@@ -59,7 +58,6 @@ module.exports = function(grunt) {
},
qunit: {
- htmllint: ['./tests/lint', 'tests/lint-tests.html'],
htmlminifier: ['./tests/minifier', 'tests/index.html']
},
@@ -71,10 +69,6 @@ module.exports = function(grunt) {
'./tests/index.html': [
/("[^"]+\/qunit-)[0-9\.]+?(\.(?:css|js)")/g,
'$1<%= qunit_ver %>$2'
- ],
- './tests/lint-tests.html': [
- /("[^"]+\/qunit-)[0-9\.]+?(\.(?:css|js)")/g,
- '$1<%= qunit_ver %>$2'
]
},
View
@@ -7,14 +7,16 @@
[![optionalDependency Status](https://img.shields.io/david/optional/kangax/html-minifier.svg)](https://david-dm.org/kangax/html-minifier#info=optionalDependencies)
[![Gitter](https://img.shields.io/gitter/room/kangax/html-minifier.svg)](https://gitter.im/kangax/html-minifier)
-[HTMLMinifier](http://kangax.github.io/html-minifier/) is a highly **configurable**, **well-tested**, JavaScript-based HTML minifier, with lint-like capabilities.
+[HTMLMinifier](http://kangax.github.io/html-minifier/) is a highly **configurable**, **well-tested**, JavaScript-based HTML minifier.
See [corresponding blog post](http://perfectionkills.com/experimenting-with-html-minifier/) for all the gory details of [how it works](http://perfectionkills.com/experimenting-with-html-minifier/#how_it_works), [description of each option](http://perfectionkills.com/experimenting-with-html-minifier/#options), [testing results](http://perfectionkills.com/experimenting-with-html-minifier/#field_testing) and [conclusions](http://perfectionkills.com/experimenting-with-html-minifier/#cost_and_benefits).
[Test suite is available online](http://kangax.github.io/html-minifier/tests/).
Also see corresponding [Ruby wrapper](https://github.com/stereobooster/html_minifier), and for Node.js, [Grunt plugin](https://github.com/gruntjs/grunt-contrib-htmlmin), [Gulp module](https://github.com/jonschlinkert/gulp-htmlmin), and [Koa middleware wrapper](https://github.com/koajs/html-minifier).
+For lint-like capabilities take a look at [HTMLLint](https://github.com/kangax/html-lint).
+
## Minification comparison
How does HTMLMinifier compare to other solutions — [HTML Minifier from Will Peavy](http://www.willpeavy.com/minifier/) (1st result in [Google search for "html minifier"](https://www.google.com/#q=html+minifier)) as well as [htmlcompressor.com](http://htmlcompressor.com) and [minimize](https://github.com/Swaagie/minimize)?
@@ -54,7 +56,6 @@ How does HTMLMinifier compare to other solutions — [HTML Minifier from Will Pe
| `ignoreCustomFragments` | Array of regex'es that allow to ignore certain fragments, when matched (e.g. `<?php ... ?>`, `{{ ... }}`, etc.) | `[ /<%[\s\S]*?%>/, /<\?[\s\S]*?\?>/ ]` |
| `includeAutoGeneratedTags` | Insert tags generated by HTML parser | `true` |
| `keepClosingSlash` | Keep the trailing slash on singleton elements | `false` |
-| `lint` | [Toggle linting](http://perfectionkills.com/experimenting-with-html-minifier/#validate_input_through_html_lint) | `false` |
| `maxLineLength` | Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points |
| `minifyCSS` | Minify CSS in style elements and style attributes (uses [clean-css](https://github.com/jakubpawlowicz/clean-css)) | `false` (could be `true`, `false`, `Object` (options)) |
| `minifyJS` | Minify JavaScript in script elements and event attributes (uses [UglifyJS](https://github.com/mishoo/UglifyJS2)) | `false` (could be `true`, `false`, `Object` (options)) |
View
@@ -19,9 +19,6 @@ button { font-weight: bold; width: 100px; }
#options label + input { margin-left: 0.5em; }
#stats { margin-bottom: 2em; overflow: hidden; margin-top: 0; }
#todo { font-family: monospace; margin-bottom: 2em; }
-#lint-report { font-family: monospace; }
-#report { margin-bottom: 5em; }
-#report ul { margin: 0.5em; padding-left: 1em; list-style: none; }
.success { color: green; }
.failure { color: red; }
View
@@ -2,7 +2,6 @@
'use strict';
var minify = require('html-minifier').minify;
- var HTMLLint = require('html-minifier/src/htmllint').HTMLLint;
function byId(id) {
return document.getElementById(id);
@@ -31,12 +30,6 @@
}
}
switch (key) {
- case 'lint':
- if (!value) {
- return;
- }
- value = new HTMLLint();
- break;
case 'maxLineLength':
value = parseInt(value);
break;
@@ -61,7 +54,6 @@
byId('minify-btn').onclick = function() {
try {
var options = getOptions(),
- lint = options.lint,
originalValue = byId('input').value,
minifiedValue = minify(originalValue, options),
diff = originalValue.length - minifiedValue.length,
@@ -75,13 +67,6 @@
'. Minified size: <strong>' + commify(minifiedValue.length) + '</strong>' +
'. Savings: <strong>' + commify(diff) + ' (' + savings + '%)</strong>.' +
'</span>';
-
- if (lint) {
- lint.populate(byId('report'));
- }
- else {
- byId('report').innerHTML = '';
- }
}
catch (err) {
byId('output').value = '';
View
@@ -30,7 +30,6 @@
var changeCase = require('change-case');
var concat = require('concat-stream');
var fs = require('fs');
-var HTMLLint = require('./src/htmllint').HTMLLint;
var info = require('./package.json');
var minify = require('.').minify;
var path = require('path');
@@ -114,7 +113,6 @@ var mainOptions = {
ignoreCustomFragments: ['Array of regex\'es that allow to ignore certain fragments, when matched (e.g. <?php ... ?>, {{ ... }})', parseJSONRegExpArray],
includeAutoGeneratedTags: 'Insert tags generated by HTML parser',
keepClosingSlash: 'Keep the trailing slash on singleton elements',
- lint: 'Toggle linting',
maxLineLength: ['Max line length', parseInt],
minifyCSS: ['Minify CSS in style elements and style attributes (uses clean-css)', parseJSON],
minifyJS: ['Minify Javascript in script elements and on* attributes (uses uglify-js)', parseJSON],
@@ -206,9 +204,6 @@ function createOptions() {
options[key] = config[key];
}
});
- if (options.lint) {
- options.lint = new HTMLLint();
- }
return options;
}
@@ -256,9 +251,6 @@ function writeMinify(content) {
try {
var options = createOptions();
minified = minify(content, options);
- if (options.lint) {
- options.lint.populate();
- }
}
catch (e) {
fatal('Minification error:\n' + e.message);
Oops, something went wrong.

0 comments on commit 22d1340

Please sign in to comment.