From 68981b79b53c232e834bf04341228a202c9e9bdc Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 20 Mar 2018 02:13:53 +0800 Subject: [PATCH] fix corner case in `decodeEntities` (#894) fixes #893 --- src/htmlminifier.js | 10 +++++----- tests/minifier.js | 8 ++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) 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(/