diff options
-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| |