Syntastic: Syntastic is unable to recognize HTML templates and throws syntax errors

Created on 28 Apr 2012  路  17Comments  路  Source: vim-syntastic/syntastic

If the following is found in the head element of a HTML page, Syntastic will complain about the html tags not being allowed within the tag. Can we some how modify the HTML checker to either detect the scripts type attribute and simply not parse the following. Or, if possible, parses it using a handlebars syntax checker? (if one exists).

Code placed in comment below since code-formatting was being fussy.

syntax checkers

Most helpful comment

We havent found a decent way to check html yet really. Tidy is pretty clunky and we already filter out a lot of the useless errors.

If it is driving insane, you can chuck this in your vimrc: let syntastic_mode_map = { 'passive_filetypes': ['html'] }

that will make is so html files are only checked if you explicitly run :SyntasticCheck. I'm guessing this is what @distracteddev has done already.

Yeah, any alternative syntax checker suggestions/pull-requests for html are welcome for sure.

All 17 comments

<script type="text/x-handlebars" data-template-name="posts">
    {{#each content}}
    <div class="row">
        <section class="post columns eight centered mock">
            <section class="post-header">
                <h2>{{title}}</h2>
                <h5>{{sub_title}}</h5>
                {{#each tags}}
                    <p>{{this}}</p>
                {{/each}}
                <p class="post-body">{{body}}</p>
            </section>
        </section>
    </div>
    {{/each}}
</script>

+1 also have needed to turn off syntastic for html due to this

+1 Syntastic complains about