The html/validator checker chokes on empty lines in curl output.
This commit is contained in:
parent
2fbd870a20
commit
c035ac2426
@ -52,24 +52,26 @@ function! SyntaxCheckers_html_validator_IsAvailable()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SyntaxCheckers_html_validator_Preprocess(errors)
|
function! SyntaxCheckers_html_validator_Preprocess(errors)
|
||||||
let out = copy(a:errors)
|
let out = []
|
||||||
for n in range(len(out))
|
for e in a:errors
|
||||||
let parts = matchlist(out[n], '\v^"([^"]+)"(.+)')
|
let parts = matchlist(e, '\v^"([^"]+)"(.+)')
|
||||||
" URL decode, except leave alone any "+"
|
if len(parts) >= 3
|
||||||
let parts[1] = substitute(parts[1], '\m%\(\x\x\)', '\=nr2char("0x".submatch(1))', 'g')
|
" URL decode, except leave alone any "+"
|
||||||
let parts[1] = substitute(parts[1], '\\"', '"', 'g')
|
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 parts[1] = substitute(parts[1], '\\\\', '\\', 'g')
|
||||||
|
call add(out, '"' . parts[1] . '"' . parts[2])
|
||||||
|
endif
|
||||||
endfor
|
endfor
|
||||||
return out
|
return out
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SyntaxCheckers_html_validator_GetLocList()
|
function! SyntaxCheckers_html_validator_GetLocList()
|
||||||
|
let fname = syntastic#util#shexpand('%')
|
||||||
let makeprg = 'curl -s --compressed -F out=gnu -F asciiquotes=yes' .
|
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_parser) ? ' -F parser=' . g:syntastic_html_validator_parser : '') .
|
||||||
\ (!empty(g:syntastic_html_validator_nsfilter) ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') .
|
\ (!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('%') . ' ' .
|
\ ' -F doc=@' . fname . '\;type=text/html\;filename=' . fname . ' ' . g:syntastic_html_validator_api
|
||||||
\ g:syntastic_html_validator_api
|
|
||||||
|
|
||||||
let errorformat =
|
let errorformat =
|
||||||
\ '%E"%f":%l: %trror: %m,' .
|
\ '%E"%f":%l: %trror: %m,' .
|
||||||
|
Loading…
x
Reference in New Issue
Block a user