summaryrefslogtreecommitdiff
path: root/ale_linters/html
diff options
context:
space:
mode:
authorrhysd <lin90162@yahoo.co.jp>2018-01-03 01:42:08 +0900
committerrhysd <lin90162@yahoo.co.jp>2018-01-03 01:50:31 +0900
commit401b964e9ce212bfaafd98f7ef075ab5f9d7c805 (patch)
tree085199a43a14e2c22f955f6ca7d7a7ab024e8206 /ale_linters/html
parent5285b0b332f067f56a6ac13a316db64acbac0c6b (diff)
downloadale-401b964e9ce212bfaafd98f7ef075ab5f9d7c805.zip
html: Avoid old tidy on macOS
On macOS, Apple's command line toolchain installs very old `tidy` command (It was released on 31 Oct 2006). It does not consider new specs such as HTML5 so we should avoid it.
Diffstat (limited to 'ale_linters/html')
-rw-r--r--ale_linters/html/tidy.vim10
1 files changed, 9 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
\)