-
Notifications
You must be signed in to change notification settings - Fork 584
Closed
Description
Hi Juriy,
The regexp backreferences usage in ignoreCustomFragments was affected from 3.0.3 version, here my case:
{
ignoreCustomFragments: [ /<(WC@[\s\S]*?)>(.*?)<\/\1>/ ]
}
The grouping update of regexp expression in the code below (htmlminifier.js) was the problem because the \1 backreference points to first group and not to ignoreCustomFragments group expression (so logically my regexp stop working):
in v3.0.3:
html-minifier/src/htmlminifier.js
Line 865 in 89c2968
| var reCustomIgnore = new RegExp('\\s*(?:' + customFragments.join('|') + ')+\\s*', 'g'); |
new RegExp('\s_(?:' + customFragments.join('|') + ')+\s_', 'g')
in v3.1.0:
html-minifier/src/htmlminifier.js
Line 872 in 969d21a
| var reCustomIgnore = new RegExp('(\\s*)(?:' + customFragments.join('|') + ')+(\\s*)', 'g'); |
new RegExp('(\s_)(?:' + customFragments.join('|') + ')+(\s_)', 'g');
any plans of update ?
Thks !!!
Metadata
Metadata
Assignees
Labels
No labels