diff --git a/src/htmlminifier.js b/src/htmlminifier.js index 4bdef7e4..e16c772e 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -1153,11 +1153,6 @@ function minify(value, options, partialMarkup) { trimTrailingWhitespace(buffer.length - 1, nextTag); } } - else if (uidPattern) { - text = text.replace(uidPattern, function(match, prefix, index) { - return ignoredCustomMarkupChunks[+index][0]; - }); - } if (!stackNoCollapseWhitespace.length && nextTag !== 'html' && !(prevTag && nextTag)) { text = collapseWhitespace(text, options, false, false, true); } @@ -1191,6 +1186,11 @@ function minify(value, options, partialMarkup) { // https://mathiasbynens.be/notes/ambiguous-ampersands text = text.replace(/&(#?[0-9a-zA-Z]+;)/g, '&$1').replace(/">baz<moo>\u00a9'; assert.equal(minify(input, { decodeEntities: true }), output); + + input = ' & ?>&
& ?>&'; + assert.equal(minify(input), input); + assert.equal(minify(input, { collapseWhitespace: false, decodeEntities: false }), input); + assert.equal(minify(input, { collapseWhitespace: true, decodeEntities: false }), input); + output = ' & ?>&
& ?>&'; + assert.equal(minify(input, { collapseWhitespace: false, decodeEntities: true }), output); + assert.equal(minify(input, { collapseWhitespace: true, decodeEntities: true }), output); }); QUnit.test('tests from PHPTAL', function(assert) {