Help:Lint errors/tidy-whitespace-bug/ja
このページのヘルプ テキストは Tidy を参照していますが、これは現在ウィキメディア クラスターでは使用されていません。 2018年7月に RemexHtml に置き換えられました。 |
問題点
Tidy は内側のタグから外側のタグに空白を除去します。
Tidy で処理すると
<span>a </span><span>b</span>
は
<span>a</span> <span>b</span>
になります。
空白文字が span の内部から外部に移動し、2つの span を分離している様子を確認してください。 これは、span に空白に影響する CSS が適用されている場合に問題となります。 例えば、要素に CSS の white-space プロパティが設定されている場合です。
<span style='white-space:nowrap'>a </span><span style='white-space:nowrap'>b</span>
は
<span style='white-space:nowrap'>a</span> <span style='white-space:nowrap'>b</span>
になります。
つまり、30 個の span が連続していても、Tidy が空白を移動させるため、ブラウザーは span 間でレンダリングを分割してしまう可能性があります。 しかし、Parsoid や RemexHTML のような HTML5 パーサーでは、このように空白が移動されることはありません。 So, there is no place for the browser to break the line since there is no whitespace between spans. This causes the row of spans to extend horizontally indefinitely.
解決策
This is most likely to affect on pages that have a list of entries. This usually comes from templates. So, editors will have to do what Tidy does by moving space around. One simple solution would be to add a whitespace character after the span in the affected template like in this itwiki example which is used in w:it:Template:Campioni_NBA and which was rendering badly before this fix.
ツール
The following tools can help fix tidy whitespace bug:
Tidy whitespace bug may be reported by WPCleaner as part of CheckWiki error #536.