手册:$wgWellFormedXml

This page is a translated version of the page Manual:$wgWellFormedXml and the translation is 67% complete.
Other languages:
English • ‎español • ‎français • ‎magyar • ‎中文 • ‎日本語
输出: $wgWellFormedXml
是否尝试使我们的HTML输出格式正确的XML。
引进版本:1.16.0 (r54767)
移除版本:1.27.0
允许的值:(布尔值)
默认值:true

细节

即使$wgHtml5 为true,是否尝试使HTML输出格式正确的XML。

如果设置为false,则输出将短几个字节,并且HTML可能更具可读性。 如果设置为true,那么对于屏幕抓取机器人的创作者来说,生活会容易得多,并且HTML可能更具可读性。

Setting this to false may omit quotation marks on some attributes, omit slashes from some self-closing tags, omit some ending tags, etc., where permitted by HTML5. Setting it to true will not guarantee that all pages will be well-formed, although non-well-formed pages should be rare and you should report them as a bug if you find one. Conversely, setting it to false doesn't mean that all XML-y constructs will be omitted, just that they might be.

Because of compatibility with screen-scraping bots, and because it's controversial, this is currently left to true by default.

In version 1.16.0, this implies the doctype is changed to XHTML 1.0 Strict to make named character references work in XML. 从版本1.17开始,避免使用命名字符引用。

在MediaWiki 1.27中将其删除后,先前的默认模式$wgWellFormedXml = true;是MediaWiki将来使用的模式。

$wgWellFormedXml的删除被反向移植到1.23.15和1.26.4。