The HTML5 standard says that the XML-ish self-closed tag syntax `<TAGNAME/>` (note the trailing slash) is ignored: tags are "self-closed" iff the tag name matches a list of "void tags". [[https://www.w3.org/TR/html5/syntax.html#void-elements|The only valid void HTML tags]] are //area, base, br, col, embed, hr, img, input, keygen, link, meta, param, source, track, wbr//
As such `<b/>` and `<span/>` are treated exactly the same as `<b>`, `<span>` in a HTML5 parser. But, the situation is a bit complicated in mediawiki.
* Without tidy turned on, the Sanitizer mostly enforced this constraint but rewrote `<b/>` as `<b/>`. That isn't strictly according to the HTML5 spec (which would rewrite it as `<b>`) but does get the point across that this is invalid HTML syntax.
* When tidy is enabled, tidy replaces `<b/>` with nothing, that is, it removes the invalid tag from the output. This has led to its (ab)use as a way to protect leading/trailing whitespace and punctuation in templates. However, there are alternative ways to do this, including `<nowiki/>` and ` `, which don't violate the HTML5 parsing rules.
* However when we replace Tidy with a HTML5 parser (See T89331), Mediawiki will start enforcing the HTML5 standard and parse `<b/>`, `<span/>` as start tags which can break rendering on pages that might (deliberately or accidentally) rely on Tidy removing these tags.
In order to facilitate a smooth migration away from Tidy, we are deprecating the use of non-void self-closed HTML tags (so, to repeat, //area, base, br, col, embed, hr, img, input, keygen, link, meta, param, source, track, wbr// can be written in self-closed tag form and need not be changed). Additionally, we have started tagging pages using this invalid form with the `[[Category:Pages using invalid self-closed HTML tags]]` tracking category. Once pages which use this construct are cleaned up, we'll change both the "tidy" and the "no tidy" case to be consistent with the HTML5 parsing standard; that is, `<b/>` will be transformed into `<b>`.
Additionally, registered extension tags aren't subject to this consideration since they aren't HTML5 tags. So, for example, `<ref />` and `<references />` can continue to be used.