darcyparker/syntastic — comment on commit 8ddb0037af3c9eb70473108c8191b6a13dba32ce
File:  line 0
By darcyparker:

@scrooloose To debug, I created a renamed tidy.exe to something else (tidy2.exe) and created tidy.cmd with this:

@echo %0 %* > d:\test.txt

This lets me see what is being passed by vim/syntastic to tidy.

Before my modifications, the output looks like this:

tidy -utf8 --new-blocklevel-tags 'section, article, aside, hgroup, header, footer, nav, figure, figcaption' --new-inline-tags 'video, audio, embed, mark, progress, meter, time, ruby, rt, rp, canvas, command, details, datalist' --new-empty-tags 'wbr, keygen' -e "index.html"

This is basically what you'd expect. The problem is that cmd.exe does not recognize single quotes ('). To wrap arguments with spaces in them on win32 or win64, it requires double quotes ("). Unfortunately it doesn't seem to be something that can be fixed with shellescape() because cmd.exe doesn't recognize escaped single (')... As a result, tidy.exe doesn't parse the parameters passed to it properly and therefor syntastic fails to display errors/warnings.

After my modification, this is what I see:
tidy -utf8 --new-blocklevel-tags "section, article, aside, hgroup, header, footer, nav, figure, figcaption" --new-inline-tags "video, audio, embed, mark, progress, meter, time, ruby, rt, rp, canvas, command, details, datalist" --new-empty-tags "wbr, keygen" -e "index.html"

And after putting tidy.exe back and removing tidy.cmd, syntastic works properly.

Note: Another thing I tried - and it works:

let makeprg="tidy ".encopt." --new-blocklevel-tags ".shellescape('section, article, aside, hgroup, header, footer, nav, figure, figcaption')." --new-inline-tags ".shellescape('video, audio, embed, mark, progress, meter, time, ruby, rt, rp, canvas, command, details, datalist')." --new-empty-tags ".shellescape('wbr, keygen')." -e ".shellescape(expand('%'))." 2>&1"

Maybe you'd like this last solution better? (Fortunately shellescape() knows to replace the single quote (') to double quote (").)