* Affected components: MediaWiki core, default wikitext parser.
* Engineer(s) or team for initial implementation: Parsing Team.
* Code steward: Parsing Team.
RFC T118517 approved use of semantic HTML5 `<figure>` tags for media content, as described in [[ https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images | Parsoid's spec ]].
However, `<figure>` elements are not considered "phrasing content" in HTML5, and therefore do not capture the proper semantics in all contexts in which media can be used in wikitext.
One solution to that would be for the parser to use `<figure-inline>` tags instaead for media in contexts where phrasing content should be used.
The "-inline" suffix comes from the HTML4 block vs inline distinction, where "inline" [[ https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements#Block-level_vs._inline | roughly corresponds ]] with HTML5 phrasing content. At this point, it can be thought of more as a wikitext construct.
Currently, the Parsoid service (as non-default MW parser) already implements this spec as well as a custom `<figure-inline>` element, and that seems to be working well in practice. However, while custom elements are permitted by the standard, there is a concern that we're picking an overly broad name that may eventually lead to conflict.
This RFC is about deciding whether and what element to use in the default parser of MediaWiki core (e.g. by it to both the legacy and Parsoid parsers, or by applying it to Parsoid before it becomes the default).
//(TBD: Specify the features or criteria that need to be met.)//
Some options to consider,
- Use a vendor prefixed name instead for phrasing content, like `<mw-figure-inline>`
- Use a vendor prefixed name in all contexts, instead of the standard `<figure>`, for all around consistency and to avoid breaking paragraphs
- Push to get `<figure-inline>` standardized first, since there might be more goodwill if go that route before shipping it
- Revert to using a non-semantic `<span>` tag for phrasing content
The #parsing-team would like to champion going forward with the `<figure-inline>` tag as is. It has a shorter-term goal of [[ https://www.mediawiki.org/wiki/Parsing/Parser_Unification | unifying ]] the legacy wikitext parser (#mediawiki-parser) with #parsoid, and getting their media output to match is one step along that road. Bringing a proposal to a standards body is good idea but we should arrive with use cases, not necessarily solutions.