iCodes
iCodes

Reputation: 1457

Parse error while using grunt-contrib-htmlmin?

I am trying to minify HTML files using grunt-contrib-htmlmin.However I keep getting a Parse Error.Below is the command line response.

Running "htmlmin:dist" (htmlmin) task
Warning: template/applications/applications.html
Parse Error: <a class="btn btn-default" href="#" role="button" data-i18n="[title
]Reset_filter" , data-bind="click:function(){clearfilter('jqxgridApplications')}
"><i class="icon-reset-filter"></i></a>
                        <a class="btn btn-default" href="#" role="button" da
 ta-toggle="modal" data-target="#hideShowColumns" ,data-i18n="[title]show_hide" d
ata-bind="click: function () {openPopup('modelShowHideCol','jqxgridApplications'
)}"><i class="icon-hide-column"></i></a>
                        <a class="btn btn-default" href="#" role="button" da
ta-i18n="[title]exportToXls" data-bind="click:function(){exportToExcel(true,'jqx
gridApplications')}"><i class="icon-export-excel"></i></a>
                        <a class="btn btn-default" href="#" role="button" da
ta-i18n="[title]refresh_data" data-bind="click:function(){refreshGrid('jqxgridAp
plications')}"><i class="icon-spinner9"></i></a>

                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-md-12">
                    <div class="grid-area">
                        <div id="jqxgridApplications" style="width:100%">
                        </div>
                        <div id="pagerDivApplication"></div>
                    </div>
                </div>
            </div>

            <div class="modal fade bs-example-modal-lg" id="applicationModel
" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="myModalLab
el" aria-hidden="true">
                <div data-bind="if: templateFlag">
                    <div data-bind='component:observableModelPopup'>

                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
</div> Use --force to continue.

Aborted due to warnings.

Even if I use --force the error is same? Any help is really appreciated.

below is how I have defined the htmlmin task.

htmlmin: {
dist: {
  files: [{
     expand: true,
     cwd: 'template',
     src: '**/*.html',
     dest: 'template_dist/'
   }]
 }
}

Upvotes: 0

Views: 1703

Answers (1)

MForMarlon
MForMarlon

Reputation: 861

Your first two anchor elements have an extra comma in between the data attributes. The first has a comma after the data-i18n attribute, and the second has a comma after data-target. Try removing the commas, and see if the parse error goes away.

Upvotes: 1

Related Questions