Skip to content

Commit ec680d6

Browse files
committed
checks if tidy5 (tidy-html5) is installed with different executable
Signed-off-by: Harald Atteneder <harald.atteneder@gmail.com>
1 parent ede470f commit ec680d6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

linter.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111
"""This module exports the HtmlTidy plugin class."""
1212

1313
from SublimeLinter.lint import Linter, util
14-
14+
import shutil
1515

1616
class HtmlTidy(Linter):
1717

1818
"""Provides an interface to tidy."""
1919

2020
syntax = 'html'
21-
cmd = 'tidy -errors -quiet -utf8'
21+
if shutils.which('tidy5'):
22+
cmd = 'tidy5 -errors -quiet -utf8'
23+
else:
24+
cmd = 'tidy -errors -quiet -utf8'
2225
regex = r'^line (?P<line>\d+) column (?P<col>\d+) - (?:(?P<error>Error)|(?P<warning>Warning)): (?P<message>.+)'
2326
error_stream = util.STREAM_STDERR

0 commit comments

Comments
 (0)