![](/img/trans.png)
[英]Sublime Text 3 - Sublime Linter 3 - Why isn't “HTML Tidy” working?
[英]HTML Tidy configuration not working
我正在嘗試將HTML Tidy與Sublime Text 3結合使用,但是我不知道應該如何配置它。
我運行了一個tidy -help-config
命令來獲取可用配置選項的列表。 然后,我嘗試像這樣使用它們:
tidy index.html --uppercase-attributes yes
如果我在此處放置了無效的選項,則會出現錯誤,這很好。 但是,如果我輸入正確的選項(如上面的選項),則感覺只是被忽略了。 輸出始終相同,警告也相同。
我不希望它無法通過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
不知道為什么沒有警告或什么。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.