The granddaddy of HTML tools, with support for modern standards.
There used to be a fork called tidy-html5 which since became the official thing. Here is its GitHub repository.
Tidy is a console application for Mac OS X, Linux, Windows, UNIX, and more. It corrects and cleans up HTML and XML documents by fixing markup errors and upgrading legacy code to modern standards.
For your needs, here is the command line to call Tidy:
发布评论
评论(5)
我认为 HTML tidy 是该领域家喻户晓的名字之一。
I think HTML tidy is one of the household names in that field.
要获得此问题的更新的、与操作系统无关的答案:
虽然 原始 < href="http://tidy.sourceforge.net/" rel="nofollow noreferrer">HTMLTidy 项目已休眠超过 6 年,“W3C 社区和业务小组”,名称为 “HTML Tidy Advocacy Community Group ( HTACG)”现已开始继续开发,目标是使其完全兼容 HTML5。该组织成立于 2015 年 1 月,尽管他们将当前状态描述为“正在进行中”,但二进制文件已经可供下载。
To have an updated, OS-agnostic answer to this question:
While the original HTMLTidy project has been dormant for over 6 years, a "W3C Community & Business group" that goes by the name "HTML Tidy Advocacy Community Group (HTACG)" has now begun to continue its development, with the goal of making it fully HTML5-compatible. The group was formed in January 2015 and although they describe the current state as "work in progress", binaries are already available for download.
只是对 OT 问题的后期跟进。
正如您所期望的那样,Homebrew 安装了
tidy-html5
。它被链接为
tidy5
。Just a late followup on an OT question.
Homebrew has a
tidy-html5
installed as you'd expect.It's linked up as
tidy5
.查看 HTML Tidy 项目:http://www.html-tidy.org/
曾经有一个名为 tidy-html5 的分支,后来成为官方的东西。这是其 GitHub 存储库。
根据您的需要,以下是调用 Tidy 的命令行:
Have a look at the HTML Tidy Project: http://www.html-tidy.org/
There used to be a fork called tidy-html5 which since became the official thing. Here is its GitHub repository.
For your needs, here is the command line to call Tidy:
更新 2018:
homebrew/dupes
现已弃用,可以直接安装 tidy-html5。原始回复:
OS X 的
Tidy
不支持HTML5
。但 Github 上有一个实验分支可以做到这一点。得到它:
就是这样!玩得开心!
Update 2018: The
homebrew/dupes
is now deprecated, tidy-html5 may be directly installed.Original reply:
Tidy
from OS X doesn't supportHTML5
. But there is experimental branch onGithub
which does.To get it:
That's it! Have fun!