Skip to content

Commit df47897

Browse files
committed
minor cleanup
1 parent cf1e15b commit df47897

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/htmlcmp/tidy_output.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import argparse
66
import json
77
import subprocess
8-
import shlex
98
from pathlib import Path
109

1110
from htmlcmp.common import bcolors
@@ -21,10 +20,10 @@ def tidy_json(path):
2120

2221

2322
def tidy_html(path, html_tidy_config=None):
23+
cmd = ["tidy"]
2424
if html_tidy_config:
25-
cmd = shlex.split(f'tidy -config "{html_tidy_config.resolve()}" -q "{path}"')
26-
else:
27-
cmd = shlex.split(f'tidy -q "{path}"')
25+
cmd.extend(["-config", str(html_tidy_config.resolve())])
26+
cmd.append(str(path))
2827
result = subprocess.run(
2928
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True
3029
)

0 commit comments

Comments
 (0)