2015-02-09 39 views

回答

0

htmlclean任務允許使用protect選項來防止從匹配字符串中剝離空白。你可以設置一個正則表達式匹配一個單詞,後面跟着一個開始標籤,例如

grunt.initConfig({ 
    htmlclean: { 
    options: { 
     protect: /\w(\s+)</g 
    } 
    } 
}); 

查看https://github.com/anseki/grunt-htmlclean#overview的選項。