-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
customAttrCollapse doesn't respect conservativeCollapse #50
Comments
Hi @xReeQz, can you provide a full example code for the html-minifier-terser so we have a testcase and the options that you use? https://github.com/terser/html-minifier-terser/blob/v5.1.1/src/htmlminifier.js#L327 |
@DanielRuf here's an HTML sample: <ui-select-choices
repeat="status in segment.statuses |
filter: {displayName: $select.search}
track by status.id"
>
<span class="tu-match"
ng-bind-html="status.displayName |
highlight: $select.search"
></span>
</ui-select-choices> The options I use are: {
caseSensitive: true,
collapseWhitespace: true,
conservativeCollapse: true,
keepClosingSlash: true,
minifyCSS: true,
minifyJS: true,
removeComments: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
customAttrCollapse: /(ng-class|messages|repeat)/
} |
We have a similar issue in an Angular project, where multiple consecutive spaces get removed from our i.e.
becomes
changing https://github.com/terser/html-minifier-terser/blob/v5.1.1/src/htmlminifier.js#L328 to be
fixes our issue, but I'm not sure of the reasoning behind the |
Can you test if this would result in a green CI build? You can provide a PR and we can see then if there are any negative side-effects or not. |
In our angular.js based app we have attributes with long expressions which we sometimes spread over multiple lines like this:
Earlier we used minimize to minify HTML and that stuff would be collapsed correctly into:
Now after switching to webpack + html-loader we noticed that such attributes are not processed at all by default.
customAttrCollapse
+conservativeCollapse
looked like exactly what we need, however it turned out that they don't work together. Is there a way to work around that?The text was updated successfully, but these errors were encountered: