html-minifier
html-minifier copied to clipboard
reCustomIgnore RegExp problem
template:
<div id={{test}} class='{{test2}}' name="1994"></div>
html-minifier option:
ignoreCustomFragments: [
/<%(#?)((?:==|=#|[=-])?)[ \t]*([\w\W]*?)[ \t]*(-?)%>/,
/{{([@#]?)[ \t]*(\/?)([\w\W]*?)[ \t]*}}/,
/\bsrc="([^"]*)"/
]
render:
<div id="123 " class="" name="1994"></div>
problem: There's an extra space
htmlminifier.js code
var reCustomIgnore = new RegExp('\\s*(?:' + customFragments.join('|') + ')+\\s*', 'g');
Can’t verify right now but this should work in HTML Minifier Next. Will try to review this by myself, but would also be curious to learn more if you or anyone gets to this earlier.