2

I've searched around for how to configure vim/syntastic to process mixed Jinja/Html files but haven't found the configuration steps with the right linter for Jinja/Html files. Does anyone know if there is a way to configure Syntastic to handle filetype jinja.html?

The issue that caused me to consider this issue is a Jinja/Html template file with this line

<li><a href="{{ url_for('about') }}">About</a></li>

Vim and Syntastic both report the filetype as jinja.html so they are aware of the mixed file.

The html/tidy checker report these error:

layout.html|23 col 11 warning| <a> escaping malformed URI reference
layout.html|23 col 11 warning| <a> illegal characters found in URI 

After checking I think this is correct Jinja/Html syntax. If so, then tidy is probaby not the right checker. Is there a checker or checker configuration that checks the syntax of mixed Jinja/Html files?

2
  • 1
    Syntastic doesn't care about the contents of your files, it just runs third-party linters against them and show you the results. Then filetype=jinja.html just means syntastic will (try to) run linters for both jinja and html. Since there is no syntastic linter for jinja, you only get your file checked as html. Whether the results are useful or not is up to you, syntastic doesn't magically invent linters for random formats. For better results you'd need a linter specifically for Jinja, and a syntastic checker for it. Neither seem to exist at this time though.
    – lcd047
    Feb 5 at 10:33
  • Thank you, I'll update the question to include asking about a jinja or jinja/html linter. I haven't found one but maybe someone will point one out or one will come available.
    – DC Slagel
    Feb 5 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.