帮助:Lint錯誤/不合法內容

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Help:Lint errors/fostered and the translation is 44% complete.
Other languages:
English • ‎español • ‎polski • ‎中文 • ‎日本語

不合法內容錯誤是表格結構中有些內容不可見時觸發的錯誤。具體來說,表格內容只能放在表格單元格、表格標題或說明中。

插入在其他地方的內容會被移動到表格之前(本錯誤英文為「fostering」,表示內容被養父母所收養),參見下面的範例。

圖片的左邊顯示在表格標記內的不合法內容,而右邊顯示在瀏覽器中渲染的結果

The example above shows screenshots from a page on the English Wikipedia. On the left that shows wikitext markup, you see the bold header inside the table after a table row (|-) but outside a table cell (|). On the right that shows the rendering in a browser, you see that the header actually shows up before the table rather than inside it. In this example, it is clear that the intent of the author is for the heading to be outside the table. So, the markup should be fixed to move the heading markup outside the table as well.

In other examples, where the missing table cell markup (or heading or caption) is missing, it should be fixed by adding | or ! or |+ markup before it as appropriate.

The HTML5 spec calls this fostered content because the header is moved outside the table and is "adopted" by a different HTML element (its "foster parent").

See also