HTML 整洁的命令行语法?

HTML Tidy command-line syntax?

为什么这不适用于 HTML Tidy?

tidy index.html --uppercase-attributes yes

(我从 tidy -help-config 命令中获得了可用配置选项的列表。)

如果我在那里输入无效选项,我会得到一个错误,这很好。但如果我输入了一个正确的选项,就像上面那个一样,感觉就像它被忽略了一样。输出始终相同,警告也相同。

我正在尝试将 HTML Tidy 与 Sublime Text 3 一起使用。如果它甚至无法从控制台运行,我不希望它使用 Sublime Text 进行配置。

示例:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>HTML Tidy</title>
</head>
<body>
    <input TYPE="text" name="foo">
</body>
</html>

如您所见,我有一个输入,其中一个属性小写,一个属性大写。无论我用 --uppercase-attributes 选项做什么,输出总是:

Info: Document content looks like HTML5
No warnings or errors were found.

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Apple macOS version 5.6.0">
<meta charset="utf-8">
<title>HTML Tidy</title>
</head>
<body>
<input type="text" name="foo">
</body>
</html>

我做错了什么?我在 macOS High Sierra 上使用 HTML Tidy 5.6.0。

好的,我自己找到了答案。

配置选项应该放在文件名之前,所以不要这样:

tidy index.html --uppercase-attributes yes

应该是这样的:

tidy --uppercase-attributes yes index.html

不确定为什么没有警告或其他任何内容。