--- /dev/null
+{
+ "name": "html-minifier",
+ "version": "0.43",
+ "description": "HTMLMinifier is a Javascript-based HTML minifier with lint-like capabilities.",
+ "keywords": ["html", "minifier", "lint"],
+ "maintainers": [{
+ "name": "Juriy Zaytsev",
+ "email": "kangax@gmail.com",
+ "web": "http://perfectionkills.com"
+ }],
+ "contributors": [{
+ "name": "Gilmore Davidson",
+ "web": "https://github.com/gilmoreorless"
+ },
+ {
+ "name": "Hugo Wetterberg",
+ "email": "hugo@wetterberg.nu"
+ }],
+ "licenses": [{
+ "type": "MIT",
+ "url": "https://github.com/hugowetterberg/html-minifier/blob/gh-pages/src/license.txt"
+ }],
+ "repositories": [{
+ "type": "git",
+ "url": "git://github.com/hugowetterberg/html-minifier.git"
+ }],
+ "engines": {
+ "node": ">=0.4.8"
+ },
+ "directories": {
+ "src": "./src"
+ },
+ "main": "./src/htmlminifier.js"
+}
+
global.HTMLLint = Lint;
-})(this);
\ No newline at end of file
+})(typeof exports === 'undefined' ? window : exports);
\ No newline at end of file
(function(global){
- var log;
+ var log, HTMLParser;
if (global.console && global.console.log) {
log = function(message) {
// "preserving" `this`
log = function(){ };
}
+ if (global.HTMLParser) {
+ HTMLParser = global.HTMLParser;
+ }
+ else if (typeof require === 'function') {
+ HTMLParser = require('./htmlparser').HTMLParser;
+ }
+
function trimWhitespace(str) {
return str.replace(/^\s+/, '').replace(/\s+$/, '');
}
// export
global.minify = minify;
-})(this);
\ No newline at end of file
+})(typeof exports === 'undefined' ? window : exports);
\ No newline at end of file
*
*/
-(function(){
+(function(global){
// Regular Expressions for parsing tags and attributes
var startTag = /^<(\w+)((?:\s*[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
var reCache = { }, stackedTag, re;
- var HTMLParser = this.HTMLParser = function( html, handler ) {
+ var HTMLParser = global.HTMLParser = function( html, handler ) {
var index, chars, match, stack = [], last = html;
stack.last = function(){
return this[ this.length - 1 ];
}
};
- this.HTMLtoXML = function( html ) {
+ global.HTMLtoXML = function( html ) {
var results = "";
HTMLParser(html, {
return results;
};
- this.HTMLtoDOM = function( html, doc ) {
+ global.HTMLtoDOM = function( html, doc ) {
// There can be only one of these elements
var one = makeMap("html,head,body,title");
}
return obj;
}
-})();
\ No newline at end of file
+})(typeof exports === 'undefined' ? window : exports);
\ No newline at end of file