Swaagie/minimize

Empty space in attribute

mtoschi opened this issue · 1 comments

I can't seem to purposely leave a blank space in an attribute. Specifically for ng-list where I want to use a space as a delimiter.

Example jade file. Runs as expected running in gulp test server.
input(type="text", name="someField", ng-model="vm.someModel", ng-list=" ", ng-trim="false")

The resulting html after a gulp build is:
<input type="text" name="someField" ng-model="vm.someModel" ng-list="" ng-trim="false">

My gulp build.js includes:

.pipe($.minifyHtml({
      empty: true,
      spare: true,
      quotes: true,
      loose: true
    }))

I have tried alternating using empty or spare individually with the same results. Is there another option or a workaround?

This is probably due to the trim() of attributes, see https://github.com/Swaagie/minimize/blob/master/lib/helpers.js#L158. That said you can use the whitespace option to prevent the trim. Closing this issue.