Manual:$wgUseTidy
![]() | この機能は、バージョン 1.33.0 で MediaWiki コアから除去されました。 この機能を使用するための代替方法については $wgTidyConfig を参照してください。 |
Tidy: $wgUseTidy | |
---|---|
Use tidy to make sure HTML output is sane. |
|
導入されたバージョン: | 1.3.0 |
廃止予定になったバージョン: | 1.26.0 (Gerrit change 235401; git #2c6c954e) |
除去されたバージョン: | 1.33.0 (Gerrit change 467972; git #6db35b3c) |
許容される値: | (真偽値) |
既定値: | false |
その他の設定: アルファベット順 | 機能順 |
詳細
Use "HTML Tidy" to make sure HTML output is sane.
HTML Tidy is a free tool that fixes broken HTML. See w:HTML tidy and http://www.w3.org/People/Raggett/tidy/
このツールを設定して、$wgUseTidy=true
を設定することで、悪意のある利用者や不適切な形式の HTML を追加する利用者がいても、ウィキが適切で準拠した HTML を出力するようにできます。
なお、MediaWiki には、利用者の HTML に対する組み込みのチェックと修正機能があり、使用できる HTML タグや属性の範囲が制限されています ($wgRawHtml =true
を設定しない限り。危険です!)
Limitations are described at Help:HTML in wikitext .
The logic for this is found in includes/parser/Sanitizer.php.
As such, you may decide that running HTML tidy over the output is not necessary.
[[Link|<div>Text</div>]]
will not actually produce a clickable link. There are several dozen particular bugs identified that are likely never to be fixed (see T4542 and its list of blockers). If you enable Tidy, you're in for a world of hurt.
設定
The location of the tidy configuration file can be set using $wgTidyConf - before MediaWiki 1.10, this was required. In later versions, a working default is provided.
However, this may not always work. See $wgTidyInternal for some more installation information.
効果
Tidy is still required to mix wiki table and HTML table syntax, as well as simple wikicode and html-style markup.
例 | コード | Tidy なしのパーサー | Tidy |
---|---|---|---|
入れ子タグの混合 | {|
|| foo
<tr><td>bar</td></tr>
|}
|
<table>
<tr>
<td> foo
<p><tr><td>bar</td></tr></p>
</td></tr></table>
|
<table>
<tr><td>foo</td></tr>
<tr><td>bar</td></tr>
</table>
|
開始/終了タグの混合 | '''foo</b>
|
<b>foo</b></b>
|
<b>foo</b>
|
定義リストの入れ子 | ; hi
:# one
|
<dl><dt> hi
<ol><li> one</li></ol>
</dt></dl>
|
<dl><dt>hi</dt><dd>
<ol><li>one</li></ol>
</dd></dl>
|
Tidy はほとんどの不正な HTML を修正できます。これは、
<table><tr></td></table>
のような悪い利用者入力や、競合する、または不適切に書かれた拡張機能 (さらにはコア ソフトウェア内のバグ) を含むことがあります。
しかし、重複した xml ID 属性値や数字で始まる ID など、厳密な XHTML 検証のすべての問題を解決するわけではありません。