From: alexlamsl
foo bar baz', '
foo \t bar\n\n\n baz
'], + ['foo bar
\tfoo\t \nbar', '
foo \t\n bar
\tfoo\t \nbar'], + /* needs to handle whitespace within and around + ['
foo bar baz', '
foo bar baz
'], + ['foo bar baz', '
foo bar baz
'], + ['foo bar baz', '
foo bar baz
'], + ['foo bar baz', '
foo bar baz
'], + */ + ['foo
', '
foo
foo ', '
foo
'], + ['foo ', '
foo
'], + // comments removed by minifier, but not by PHPTAL + ['foo', '
foo
'], + ['test 123
456
test 123
456
test 123
456
x
test 123
456
x
foo | x
foo | x
\n\n\ntest', '
\n\n\ntest'], + /* single line-break preceding
is redundant, assumingis block element + ['test', '\ntest'], + */ + // optional attribute quotes removed by minifier, but not by PHPTAL + ['', ''], + /* minifier does not optimise in HTML5 mode + ['', ''], + */ + /* minifier does not optimise in HTML5 mode + [ + '', + '' + ], + */ + ['', ''] + /* trim "title" attribute value in + [ + 'Foo x xu
foo', + 'Foo \n' + + '\n' + + '\n' + + ' x xu\n' + + '
\n' + + '
\n' + + 'foo ' + ] + */ + ].forEach(function(tokens) { + equal(minify(tokens[1], { + collapseBooleanAttributes: true, + collapseWhitespace: true, + removeAttributeQuotes: true, + removeCDATASectionsFromCDATA: true, + removeComments: true, + removeCommentsFromCDATA: true, + removeEmptyAttributes: true, + removeOptionalTags: true, + removeRedundantAttributes: true, + removeScriptTypeAttributes: true, + removeStyleLinkTypeAttributes: true, + removeTagWhitespace: true, + useShortDoctype: true + }), tokens[0]); + }); + }); + })(typeof exports === 'undefined' ? window : exports);