Page MenuHomePhabricator

Remove XHTML markup capabilities from MediaWiki
Open, Needs TriagePublic

Description

Background

It's 2022, let's be true to everyone, XHTML is dead.

We still feature support for things like self-closing tags, where Parsoid, all skins, and extensions have moved forward.
XHTML is dead, long live HTML5.*

  • Please falsify this take.

Event Timeline

Change 798999 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/core@master] HTML: Remove self-closing XHTML syntax from core

https://gerrit.wikimedia.org/r/798999

Change 914352 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/BetaFeatures@master] Make tests accept self-closing tags with/without slash

https://gerrit.wikimedia.org/r/914352

Change 914355 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/MobileFrontend@master] Make tests accept self-closing tags with/without slash

https://gerrit.wikimedia.org/r/914355

Change 914356 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Flow@master] Make tests accept self-closing tags with/without slash

https://gerrit.wikimedia.org/r/914356

Change 914356 merged by jenkins-bot:

[mediawiki/extensions/Flow@master] Make tests accept self-closing tags with/without slash

https://gerrit.wikimedia.org/r/914356

Change 914352 merged by jenkins-bot:

[mediawiki/extensions/BetaFeatures@master] Make tests accept self-closing tags with/without slash

https://gerrit.wikimedia.org/r/914352

Change 914355 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Make tests accept self-closing tags with/without slash

https://gerrit.wikimedia.org/r/914355

Change 798999 merged by jenkins-bot:

[mediawiki/core@master] HTML: Remove self-closing XHTML syntax from core

https://gerrit.wikimedia.org/r/798999

I applaud the sentiments here, though!

This was previously declined in T110616, although it may be time to reconsider.

The changes so far removed the self-closing slash from output of Html::element() and related functions. It seems to have happened mostly uneventfully (although see the bug references above), which mostly proves your point.

However, the Parser (and also Parsoid) still emit self-closing slashes most of the time – except apparently in <link> tags when deduplicating TemplateStyles, so any XML-only parser would already refuse to accept most Wikipedia articles, which I guess also proves your point.

(I found this task when working on https://gerrit.wikimedia.org/r/c/mediawiki/core/+/978692)

Change 978705 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] MediaWikiHtmlFormatter: Output `<link>` tags without self-closing slash

https://gerrit.wikimedia.org/r/978705

Change 978706 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] [WIP] MediaWikiHtmlFormatter: Output all tags without self-closing slash

https://gerrit.wikimedia.org/r/978706

Change 978706 abandoned by Bartosz Dziewoński:

[mediawiki/core@master] [WIP] MediaWikiHtmlFormatter: Output all tags without self-closing slash

Reason:

I think this would be safe to do, but I don't really want to spend my time chasing down parser tests in extensions and appropriately announcing the change, and I don't really see much value in the change itself, so let's consider this an experiment. If this kind of work fascinates you, feel free to copy this change and submit it under your own name.

https://gerrit.wikimedia.org/r/978706

Change 978705 abandoned by Bartosz Dziewoński:

[mediawiki/core@master] MediaWikiHtmlFormatter: Output `<link>` tags without self-closing slash

Reason:

https://gerrit.wikimedia.org/r/978705