Help:Lint errors/self-closed-tag

Pages on this list contain invalid self-closed HTML tags, such as ,, , , .

(Valid tags defined in the  specification, like ,, , do not cause this error.) The full list of valid self-closing tags in HTML5 is: area, base, br, col, embed, hr, img, input, keygen, link, meta, param, source, track, wbr

However, only ,,  are allowed through the parser.

The HTML pre tag is superseded by the MediaWiki XML pre tag.

The behavior of these invalid tags changed in  (deployed on Wikimedia 2–4 June 2020), to be consistent with the HTML5 specification, so their use in wikitext is deprecated.

See T134423 for more details.

Pages are also automatically placed on this list by malformed tags like  , which should usually be changed to  (remove the final slash); or by malformed constructs like <tvar|3> </>, which should usually be changed to <tvar|4><s ></s></> (move the slash from end to beginning of the closing tag).

Where an invalid <tvar|1></> or <tvar|2></> (with no attributes such as <tvar|3> </> or <tvar|4> </>) is used as a spacer to prevent wikicode from rendering in example code, like <tvar|5> </>, either replace <tvar|1></> with <tvar|6></> for valid code that achieves the same effect, or use a template-linking template such as <tvar|7></> or <tvar|8></>, as in <tvar|9></>.

Some templates include an anchor <tvar|1>id</> parameter.

When fixing self-closed <tvar|1> </> and <tvar|2> </> tags that appear immediately before such templates, consider moving the anchor text from the HTML tag to inside the template and removing the now-unneeded tag.

If a given page on this list does not appear to have any invalid self-closed tags, it may be transcluding a page or template that does.

Example

 * Invalid markup
 * abc


 * Valid markup
 * abc

Tools
The following tools can help fix invalid self-closed HTML tags:
 * WPCleaner: see instructions on how to use WPCleaner for fixing errors detected by Linter. Self closed tags may be reported by WPCleaner as part of CheckWiki error #2.