Help:Lint errors/empty-heading: Difference between revisions
add |
Marked this version for translation |
||
| (20 intermediate revisions by 5 users not shown) | |||
| Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
{{MW 1.44}} |
|||
<translate><!--T:11--> This page is about Linter error <tvar name=1>''empty-heading''</tvar>.</translate> |
|||
<translate> |
<translate> |
||
<!--T:1--> |
<!--T:1--> |
||
An empty heading occurs when the content of the heading normalizes to the empty string. For example, all of these will be empty headings and flagged on this list of lint errors. |
An empty heading occurs when the content of the heading normalizes to the empty string. For example, all of these will be empty headings and flagged on this list of lint errors. |
||
</translate> |
</translate> |
||
<syntaxhighlight lang="wikitext"> |
<syntaxhighlight lang="wikitext"> |
||
=== === |
=== === |
||
| Line 14: | Line 18: | ||
=== [[fi:Example]] === |
=== [[fi:Example]] === |
||
=== [https://www.example.com] === |
|||
=== _______ === |
|||
=== {{Use dmy dates|date=February 2020}} === (or other template with no rendered output) |
=== {{Use dmy dates|date=February 2020}} === (or other template with no rendered output) |
||
| Line 19: | Line 27: | ||
<h2 style="font-weight:bold;padding:0;margin:0;color:black;font-family:sans-serif;border:none;font-size:100%;padding-bottom:.1em"><big>[[File:Canada 10,000 banner.png|400px|link=Wikipedia:WikiProject Canada/The 10,000 Challenge]] </big> <i></i></h2> |
<h2 style="font-weight:bold;padding:0;margin:0;color:black;font-family:sans-serif;border:none;font-size:100%;padding-bottom:.1em"><big>[[File:Canada 10,000 banner.png|400px|link=Wikipedia:WikiProject Canada/The 10,000 Challenge]] </big> <i></i></h2> |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
<translate><!--T:7--> Empty heading errors can also be reported when there are unclosed ref tags.</translate> |
|||
{{tmpl|0=<translate><!--T:9--> A common error is trying to reuse a reference without the closing slash character, like $1 instead of $2.</translate> |
|||
|1={{tag|ref|params={{attr|name|"reference name"}}|open}} |
|||
|2={{tag|ref|params={{attr|name|"reference name"}}|single}} |
|||
}} |
|||
<translate> |
<translate> |
||
== Suggested fixes == <!--T:2--> |
== Suggested fixes == <!--T:2--> |
||
<!--T:3--> |
<!--T:3--> |
||
For |
For empty headings that should have content, it is recommended to replace the missing section header with "Untitled" unless there is a better, more appropriate option. |
||
</translate> |
</translate> |
||
<syntaxhighlight lang="wikitext"> |
<syntaxhighlight lang="wikitext"> |
||
=== Untitled === |
=== Untitled === |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
| ⚫ | |||
| ⚫ | |||
<translate><!--T:8--> For empty headings that are placeholders, e.g. in a draft article, filling them with appropriate text, deleting them, or commenting them out may be appropriate.</translate> |
|||
| ⚫ | |||
| ⚫ | |||
== History == <!--T:4--> |
== History == <!--T:4--> |
||
<!--T:5--> |
|||
| ⚫ | In [[<tvar name=1>phab:T368722</tvar>|T368722]], it was noted that {{ll|Parsoid}} does not generate section edit links for empty headings, whereas the legacy parser will, but with an invalid empty anchor that the link in the table of contents can't navigate to. |
||
</translate> |
</translate> |
||
| ⚫ | <translate><!--T:5--> In [[<tvar name=1>phab:T368722</tvar>|T368722]], it was noted that <tvar name=3>{{ll|Parsoid}}</tvar> does not generate section edit links for empty headings, whereas the legacy parser will, but with an invalid empty anchor that the link in the table of contents can't navigate to.</translate> |
||
<translate><!--T:10--> The creation of this lint error was discussed at <tvar name=2>[[w:Wikipedia talk:Linter/Archive 6#New lint category for empty headings]]</tvar>.</translate> |
|||
Latest revision as of 09:15, 5 April 2026
| MediaWiki version: | 1.44 |
This page is about Linter error empty-heading.
An empty heading occurs when the content of the heading normalizes to the empty string. For example, all of these will be empty headings and flagged on this list of lint errors.
=== ===
=== <!-- comment --> ===
=== <center></center> ===
=== [[File:Example.svg]] ===
=== [[fi:Example]] ===
=== [https://www.example.com] ===
=== _______ ===
=== {{Use dmy dates|date=February 2020}} === (or other template with no rendered output)
<h2 style="font-weight:bold;padding:0;margin:0;color:black;font-family:sans-serif;border:none;font-size:100%;padding-bottom:.1em"><big>[[File:Canada 10,000 banner.png|400px|link=Wikipedia:WikiProject Canada/The 10,000 Challenge]] </big> <i></i></h2>
Empty heading errors can also be reported when there are unclosed ref tags.
A common error is trying to reuse a reference without the closing slash character, like <ref name="reference name"> instead of <ref name="reference name" />.
Suggested fixes
[edit | edit source]For empty headings that should have content, it is recommended to replace the missing section header with "Untitled" unless there is a better, more appropriate option.
=== Untitled ===
Other examples may require different resolutions. For empty headings that are placeholders, e.g. in a draft article, filling them with appropriate text, deleting them, or commenting them out may be appropriate.
History
[edit | edit source]In T368722, it was noted that Parsoid does not generate section edit links for empty headings, whereas the legacy parser will, but with an invalid empty anchor that the link in the table of contents can't navigate to. The creation of this lint error was discussed at w:Wikipedia talk:Linter/Archive 6#New lint category for empty headings.