diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-01-07 16:02:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-07 16:02:49 +0000 |
commit | f1747901cc00abb7becb64c02bfccad46b66ed21 (patch) | |
tree | 71bb616d88073930448c7a41f659080293585b2a | |
parent | b6d1c419255d335a1e87a5eb32fd910081fa16ac (diff) | |
parent | 7a1a5343054549c571425b6c48ab15ca5422337a (diff) | |
download | ale-f1747901cc00abb7becb64c02bfccad46b66ed21.zip |
Merge pull request #1262 from rhysd/avoid-old-tidy
html: Avoid old tidy on macOS
-rw-r--r-- | ale_linters/html/tidy.vim | 10 | ||||
-rw-r--r-- | doc/ale-html.txt | 15 |
2 files changed, 24 insertions, 1 deletions
diff --git a/ale_linters/html/tidy.vim b/ale_linters/html/tidy.vim index 4a55d62f..34152c6b 100644 --- a/ale_linters/html/tidy.vim +++ b/ale_linters/html/tidy.vim @@ -25,8 +25,16 @@ function! ale_linters#html#tidy#GetCommand(buffer) abort \ 'utf-8': '-utf8', \ }, &fileencoding, '-utf8') + " On macOS, old tidy (released on 31 Oct 2006) is installed. It does not + " consider HTML5 so we should avoid it. + let l:executable = ale#Var(a:buffer, 'html_tidy_executable') + if has('mac') && l:executable is# 'tidy' && exists('*exepath') + \ && exepath(l:executable) is# '/usr/bin/tidy' + return '' + endif + return printf('%s %s %s -', - \ ale#Var(a:buffer, 'html_tidy_executable'), + \ l:executable, \ ale#Var(a:buffer, 'html_tidy_options'), \ l:file_encoding \) diff --git a/doc/ale-html.txt b/doc/ale-html.txt index 14e705e0..c5d5afa5 100644 --- a/doc/ale-html.txt +++ b/doc/ale-html.txt @@ -32,6 +32,21 @@ g:ale_html_htmlhint_use_global *g:ale_html_htmlhint_use_global* =============================================================================== tidy *ale-html-tidy* +`tidy` is a console application which corrects and cleans up HTML and XML +documents by fixing markup errors and upgrading legacy code to modern +standards. + +Note: +`/usr/bin/tidy` on macOS (installed by default) is too old. It was released +on 31 Oct 2006. It does not consider modern HTML specs (HTML5) and shows +outdated warnings. So |ale| ignores `/usr/bin/tidy` on macOS. + +To use `tidy` on macOS, please install the latest version with Homebrew: +> + $ brew install tidy-html5 +< +`/usr/local/bin/tidy` is installed. + g:ale_html_tidy_executable *g:ale_html_tidy_executable* *b:ale_html_tidy_executable* Type: |String| |