Manual:$wgUseTidy/zh

细节
使用“HTML Tidy”确保输出的HTML正常.

HTML Tidy是一个修复错误HTML的自由工具. 参见HTML tidy和http://www.w3.org/People/Raggett/tidy/

You may wish to setup this tool, and set $wgUseTidy=true, to ensure that the wiki outputs reasonably clean and compliant HTML, even when malicious or foolish users add corrupt/badly formatted HTML to wiki pages.

Note that MediaWiki already does some built-in checks and corrections to user's HTML, and limits the range of html tags and attributes which can be used (unless you set  Dangerous!) Limitations are described at meta:Help:HTML in wikitext. The logic for this is found in. As such, you may decide that running HTML tidy over the output is not necessary.

配置
The location of the tidy configuration file can be set using - before MediaWiki 1.10, this was required. In later versions, a working default is provided.

但是，这不一定总是可用. 参见以了解更多安装信息.

效果
Tidy is still required to mix wiki table and html table syntax, as well as simple wikicode and html-style markup.

Tidy can correct most bad HTML, which can be bad user input like or conflicting or badly written extensions (and even some bugs in the core software). However, it does not resolve all strict XHTML validation issues, such as duplicate xml ID attribute values, or IDs starting with numbers.