- Affected components: MediaWiki core, default wikitext parser.
- Engineer(s) or team for initial implementation: Parsing Team.
- Code steward: Parsing Team.
Motivation
RFC T118517 approved use of semantic HTML5 <figure> tags for media content, as described in 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. More importantly, the HTML parsing spec causes paragraphs to break around <figure> (as would <div> or any other tag which is not "phrasing content" in HTML5), so we can not use it for inline figures without breaking rendering.
One solution to that would be for the parser to use <figure-inline> tags instead for media in contexts where phrasing content should be used.
The "-inline" suffix comes from the HTML4 block vs inline distinction, where "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).
Requirements
- Decide what HTML structure to use for inline media content.
Exploration
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
Proposal A: Option 3
The Parsing-Team--ARCHIVED would like to champion going forward with option 3 <figure-inline> tag as is. It has a shorter-term goal of 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.