我正在使用JTidy ( HTML Tidy库的java端口)清理一些现有的站点。当我使用JTidy时,我的配置似乎非常严格,最终切断了页面的底部(糟糕的标记)。
当我仅通过w3c HTML验证器工具运行相同的标记时,它会将其清除,但在重写时更智能;它似乎智能地猜测丢失的标记在哪里,并相应地更新结构。
有人知道w3c使用的HTML-Tidy配置吗?
我的jtidy配置如下:
Tidy tidy = new Tidy();
tidy.setTidyMark(false);
tidy.setXHTML(true);
tidy.setXmlOut(false);
tidy.setNumEntities(true);
tidy.setSpaces(2);
tidy.setWraplen(2000);
tidy.setUpperCaseTags(false);
tidy.setUpperCaseAttrs(false);
tidy.setQuiet(false);
tidy.setMakeClean(true);
tidy.setShowWarnings(true);
tidy.setBreakBeforeBR(true);
tidy.setHideComments(true);发布于 2015-08-24 20:40:29
here提供了W3C验证器使用的整洁配置
https://stackoverflow.com/questions/9475049
复制相似问题