diff --git a/syntax_checkers/html/validator.vim b/syntax_checkers/html/validator.vim
index 04666354..745fa74b 100644
--- a/syntax_checkers/html/validator.vim
+++ b/syntax_checkers/html/validator.vim
@@ -52,24 +52,26 @@ function! SyntaxCheckers_html_validator_IsAvailable()
endfunction
function! SyntaxCheckers_html_validator_Preprocess(errors)
- let out = copy(a:errors)
- for n in range(len(out))
- let parts = matchlist(out[n], '\v^"([^"]+)"(.+)')
- " URL decode, except leave alone any "+"
- let parts[1] = substitute(parts[1], '\m%\(\x\x\)', '\=nr2char("0x".submatch(1))', 'g')
- let parts[1] = substitute(parts[1], '\\"', '"', 'g')
- let parts[1] = substitute(parts[1], '\\\\', '\\', 'g')
- let out[n] = '"' . parts[1] . '"' . parts[2]
+ let out = []
+ for e in a:errors
+ let parts = matchlist(e, '\v^"([^"]+)"(.+)')
+ if len(parts) >= 3
+ " URL decode, except leave alone any "+"
+ let parts[1] = substitute(parts[1], '\m%\(\x\x\)', '\=nr2char("0x".submatch(1))', 'g')
+ let parts[1] = substitute(parts[1], '\\"', '"', 'g')
+ let parts[1] = substitute(parts[1], '\\\\', '\\', 'g')
+ call add(out, '"' . parts[1] . '"' . parts[2])
+ endif
endfor
return out
endfunction
function! SyntaxCheckers_html_validator_GetLocList()
+ let fname = syntastic#util#shexpand('%')
let makeprg = 'curl -s --compressed -F out=gnu -F asciiquotes=yes' .
\ (!empty(g:syntastic_html_validator_parser) ? ' -F parser=' . g:syntastic_html_validator_parser : '') .
\ (!empty(g:syntastic_html_validator_nsfilter) ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') .
- \ ' -F doc=@' . syntastic#util#shexpand('%') . '\;type=text/html\;filename=' . syntastic#util#shexpand('%') . ' ' .
- \ g:syntastic_html_validator_api
+ \ ' -F doc=@' . fname . '\;type=text/html\;filename=' . fname . ' ' . g:syntastic_html_validator_api
let errorformat =
\ '%E"%f":%l: %trror: %m,' .