-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
What happened?
When running the minifier with the following input:
<style type="text/css">
{% ignore1 %}
a {
{% ignore2 %}
}
{% ignore3 %}
</style>
And settings:
{
ignoreCustomFragments: [
/\{%[\s\S]*?%\}/
],
collapseWhitespace: true,
conservativeCollapse: true,
minifyCSS: {
level: 0
},
}
The output is:
<style type="text/css"> {% ignore1 %} a{ {% ignore2 %} }</style>
Where it should be:
<style type="text/css"> {% ignore1 %} a{ {% ignore2 %} } {% ignore3 %} </style>
Full test program:
const { minify } = require('html-minifier-terser');
const html = `<style type="text/css">
{% ignore1 %}
a {
{% ignore2 %}
}
{% ignore3 %}
</style>`;
const output = minify(html, {
ignoreCustomFragments: [/\{%[\s\S]*?%\}/],
collapseWhitespace: true,
conservativeCollapse: true,
minifyCSS: {
level: 0,
},
}).then(console.info);
Version
7.2.0
What browsers are you seeing the problem on?
No response
Link to reproduce
https://stackblitz.com/edit/node-hnsagk?file=index.js
Relevant log output
No response
Willing to submit a PR?
None
Nantris
Metadata
Metadata
Assignees
Labels
No labels