Skip to content

Instantly share code, notes, and snippets.

@rafi
Last active August 29, 2015 14:07
Show Gist options
  • Save rafi/9bd15e14b10ff5a990c4 to your computer and use it in GitHub Desktop.
Save rafi/9bd15e14b10ff5a990c4 to your computer and use it in GitHub Desktop.
syntastic/syntax_checkers/html/tidy.vim (Strip mustache tags out of HTML content to ease HTMLTidy's errors)
let g:syntastic_html_tidy_ignore_errors = [
\ '<html> attribute "lang" lacks value',
\ '<a> attribute "href" lacks value',
\ 'trimming empty <span>',
\ 'trimming empty <h1>'
\ ]
diff --git a/syntax_checkers/html/tidy.vim b/syntax_checkers/html/tidy.vim
index 7dcf522..490802f 100644
--- a/syntax_checkers/html/tidy.vim
+++ b/syntax_checkers/html/tidy.vim
@@ -186,7 +186,10 @@ function! s:Args()
endfunction
function! SyntaxCheckers_html_tidy_GetLocList() dict
- let makeprg = self.makeprgBuild({ 'args_after': s:Args() })
+ let makeprg = self.makeprgBuild({
+ \ 'exe': 'sed ''s/{{\(\(.\)\?.*\?\)}}//g'' '.syntastic#util#shexpand('%').' | '.self.getExecEscaped(),
+ \ 'fname': '',
+ \ 'args_after': s:Args() })
let errorformat =
\ '%Wline %l column %v - Warning: %m,' .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment