Parsoid/Parser Unification/Media structure/FAQ

What do you mean by media structure?
When files are included in a page (ex. ), MediaWiki's parser outputs some HTML that represents that media for your browser to render. The choice of HTML tags and attributes are the structure we're considering.

What can be improved in the current structure?
It's mainly just a bunch of div tags, which don't provide much meaning. This makes it inefficient to query and style, and not very accessible. See the RFC for the finer details. The output for the example above looks like this currently:

What are you replacing it with?
We're replacing it with a different structure (that we've piloted in Parsoid) that addresses some of the shortcomings of current structure. See the media section of the spec for the details. The output for the example above will look like this:

Why are you doing this now?
A medium term goal of the Content Transform Team at the WMF is to replace MediaWiki's legacy parser with Parsoid, a bidirectional wikitext to HTML5 parser. In order to get there, the legacy parser and Parsoid need to produce compatible HTML. Parsoid has been generating this new media structure for quite some time, to good effect. In order to lessen the disruption of changing parsers all at once, we're rolling out an isolated piece in preparation for further changes to come.

How has this been tested?

 * 1) The new structure has been piloted in Parsoid which is used in several active products like Visual Editor and the mobile apps. As editors and readers used these products, they flagged rendering differences with the old structure and problems with the new structure which we've fixed those over the years.
 * 2) In addition, we've done several rounds of visual difference testing where thousands of pages are rendered with the old and new structure and the rendering compared at a pixel level.
 * 3) We've also already deployed this change to several wikis, including mediawiki.org, wikitech, and all the group 0 wikis.

What's left to do?

 * 1) Code that interacts with the page, like JavaScript for extensions, user scripts and gadgets will need to be compatible with the new structure, hopefully in a forwards and backwards compatible way.
 * 2) Skins will need to ask for the "content-media" feature or provide their own styling, since classes targeting the old structure won't apply.
 * 3) Some wikis have CSS in MediaWiki:Commons.css that will need to be ported to the new structure.

How can I help?
Test your code on the wikis we've deployed to and file tasks with the  tag.

When will you be rolling this out?
As above, it's already live on several wikis. However, we won't continue to push forward until the known issues are addressed and we've done some level of auditing of user scripts and gadgets to ensure we're causing as little disruption to readers and editors as possible.