I completely support the general idea of conformance to modern web standards. Nevertheless, I'm wondering whether there are any other benefits to changing <center> to <div style="text-align: center"> other than just modernity and cleaner semantics. Can it improve performance, rendering, forward compatibility, stability? Anything else?
Topic on Help talk:Lint errors/obsolete-tag
From https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible
It may take a long time for browsers to drop the center element, but users should be educated to not use it anymore, so nobody has to hurry to replace it when it comes the day when browsers start dropping it.
This makes sense to me, but still, I'd like to have the strongest explanations I can bring to other editors, who will likely be unhappy to see thousands of edits that don't change anything substantial. Again, I understand how it is substantial, but if possible, I'd love to have more convincing arguments.
obsolete tag is a low-priority one. But... everything in linter will cause edits that don't change anything substantial (because the page should look the same after and before the changes)... until the current MediaWiki markup start to behave differently, which is the goal of fixing those errors, and that would make them a substantial change :)
<center> is something that a bot can change easily, users may replace them while they do other edits to the same page. Anyway, I don't think <center> would be in use in many pages (maybe I'm wrong)
MediaWiki is moving towards full HTML5 compliance to clean up some of the oddness in our parsing (mostly related to the effects of tidy). Part of this means adding support for the new HTML5 tags and slowly deprecating and dropping support for the removed ones.
As for why the HTML5 standard dropped <center>, there's some good explanations in this SO answer, but the tl;dr is that HTML is supposed to describe the contents of the text, not format it (that's CSS). And center did just formatting and didn't describe it.
As Ciencia Al Poder said, this is a low priority issue and can easily be done by a bot. The English Wikipedia is slowly migrating towards w:Template:Center for example.
Yeah, that SO answer was perfectly valid... that this is something we should just ignore.
- "It describes presentation, not semantics!" No. It describes a logical arrangement - and yes, it has a default appearance, just as other tags like
<p>
or<ul>
do. But the point is the enclosed part's relation to its surroundings. Center says "this is something we separate by visually different positioning".
- "It's not valid" Yes it is. It's just deprecated, as in, could be removed later. For 15+ years now. And it's not going anywhere, apparently. There are major sites (including google.com) that use this tag because it's very readable and to the point - and those are the same reasons we like HTML5 tags for.
- "It's not supported in HTML5" It's one of the most widely supported tags, actually. MDN says "its use is discouraged since it could be removed at any time" - good point, but that day may never come, to quote a classic. Center was already deprecated in like 2004 or so - it's still here and still useful.
Completely agree. This is a waste of people's time and there should be a category below "low" to point out that this is something bots might eventually get around to fixing but in the meantime isn't something to bother with at all.