-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Syntastic is unable to recognize HTML templates and throws syntax errors #240
Comments
|
+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 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: that will make is so html files are only checked if you explicitly run 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 <% @matching.each do |match| %> <%= render :partial => 'content_row', :locals => { :name => match.mapped.name, :claim_url => match.yelp_attributes[:claim_url] } %> <% end %> |
I solved the issue for eruby files by changing the syntastic/syntax_checkers/eruby/eruby.vim to |
@gs: This looks like a job for a separate checker, rather than patching the existing one. You probably need to put |
@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 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. |
@lcd047 thanks for taking the time and implement my hack :) I missed a 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 |
@rafi thx! this worked for my ejs files:
|
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.
The text was updated successfully, but these errors were encountered: