1

I am using grunt htmlmin with mustache template, however, it seems not capable with the {{#mustache}} tag. For example,

<div class="m-icon {{^notLogin}}J_linkBtn" data-hash="#page=center"{{/notLogin}}{{#notLogin}}J_ShowLoginBox"{{/notLogin}}></div>

and I get:

<div class="m-icon {{^notLogin}}J_linkBtn" data-hash="#page=center" notlogin notlogin j_showloginbox notlogin>"></div>

I tried this solution, and I added these lines in my Gruntfile:

htmlmin: {                                    
  dist: {                                    
    options: {                               
      customAttrSurround: [
        [/\{\{(#|\^)[^}]+\}\}/, /\{\{\/[^}]+\}\}/]
      ]
    }
  }
}

but I got an error saying: Cannot read property 'toLowerCase' of undefined when running grunt, which would not appear before the changes.

How should I solve this? Thx.

Community
  • 1
  • 1
Benber Zhang
  • 71
  • 2
  • 5

0 Answers0