Closed distracteddev closed 10 years ago
<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 tags when using the Handlebars built into Meteor as well.
Syntastic is just following the spec. See 4.3.1.2 Restrictions for contents of script elements where a LESS-THAN (<)
character is not allowed.
Let it serve merely as a suggestion to organize your handlebar templates better.
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.
+1 I understand there is no current solution, just want to keep myself in the loop for this particular thread! I'm in my first week using syntastic--it's fantastic!
+1 the same problem with eruby file
I solved the issue for eruby files by changing the syntastic/syntax_checkers/eruby/eruby.vim to
let makeprg = 'erb -xT - ' . fname . ' \| ruby -c'
@gs: This looks like a job for a separate checker, rather than patching the existing one. You probably need to put shellescape(fnameescape())
around fname
though.
@lcd047: thx for your response!!
your hint worked good for me and I have now custom syntax checker :)
I will create specific eruby issue and submit pull-request
I would really like a solution to this too. For now I'm just putting it into passive mode.
@fourcolors There is now a handlebars checker.
If this is not what you mean, than please open a new report explaining what you did, what you expected to happen, and what happened instead.
Ignore specific tidy errors:
let g:syntastic_html_tidy_ignore_errors = [
\ 'plain text isn''t allowed in <head> elements',
\ '<base> escaping malformed URI reference',
\ 'discarding unexpected <body>',
\ '<script> escaping malformed URI reference',
\ '</head> isn''t allowed in <body> elements'
\ ]
Ignore all of tidy's warnings:
let g:syntastic_html_tidy_quiet_messages = { "level" : "warnings" }
I tried changing makeprg
in syntax_checkers/html/tidy.vim
with:
let fname = "'" . escape(expand('%'), "\\'") . "'"
let makeprg = 'cat '.shellescape(fnameescape(fname)).' | sed ''s/{{\(\(.\)\?.*\?\)}}//g'' | /usr/bin/tidy'
...it did not like it at all. couldn't find anything helpful in debug.
@rafi You have an unbalanced }
in your sed
pattern. You can still do it like this if you insist. However, as I pointed out elsewhere, it wouldn't really do you much good.
@lcd047 thanks for taking the time and implement my hack :) I missed a {
actually, and it's better with an empty replacement: s/{{\(\(.\)\?.*\?\)}}//g
. Together with ignoring attribute empty warnings, e.g.
let g:syntastic_html_tidy_ignore_errors = [
\ '<html> attribute "lang" lacks value'
\ ]
This is much better than the previous situation where tidy would totally lose its head around <head>
:) and I ignored a bunch of errors I previously mentioned.
@rafi thx! this worked for my ejs files:
let g:syntastic_html_tidy_ignore_errors = [
\ '<img> escaping malformed URI reference'
\ ]
let g:syntastic_html_tidy_ignore_errors = [ '<template> is not recognized!' ]
Source: https://gist.github.com/khanghoang/345cd55541eb00952fe4
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.