html - 从命令行验证 HTML

标签 html validation vim command-line

我是一名网络开发人员,越来越多地使用 Vim 来编写网站代码。是否有任何 HTML 验证实用程序(或技术)可以在不离开 shell 的情况下获取我正在处理的任何文件并根据其 DOCTYPE 进行验证?

最佳答案

从 sourceforge 中整理并在 shell 上执行
tidy -errors -q -f error_file.txt the_file.html

2016 年 7 月编辑: 源伪造版本已过时(请参阅@phihag 的评论)。它的继任者可以在 http://www.html-tidy.org/ 找到和 https://github.com/htacg/tidy-html5 .

http://www.html-tidy.org/上的历史页面 指出:

In 2015 a group of concerned developers, users, and software integrators formed HTACG with the goal of revitalizing Tidy, which had fallen into a non-maintained state. As a W3C Community Group, HTACG was deemed worthy by the W3C, and W3C passed ownership of their project to HTACG, where it is currently being developed and prepped for a new, stable, and modern release.

关于html - 从命令行验证 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1837624/

相关文章:

html - 创建一个双色圈

javascript - HTML 无限平移 Canvas

intellij-idea - PyCharm + IdeaVim -- 如何重新绑定(bind) Ctrl-C?

c++ - 在 vim 中自动关闭 C/C++ 文件中的 xml 标签

php - 用于重定向的 php header

jquery - 如何在使用切换时通过单击其他元素来隐藏元素?

xml - 如何使用 Firefox 验证 XML?

java - JSR-303 验证的@NotNull 说明

ruby-on-rails - 表中列中的字符限制与 Rails 中的验证

vim - 在 autocmd 中重新加载 .vimrc 会中断电力线