Specs/HTML/2.5.0/Extensions/Gallery

Changes since Specs/HTML/2.2.0/Extensions/Gallery

 * T292657: mw-file-description added to media links to the file description page, which is the default
 * T108380: Set title for tooltips on media if caption isn't visible
 * T273505: Merge mw:Image|mw:Audio|mw:Video into a single mw:File
 * T297443: Use caption as alt on imgs when not present and caption isn't visible

The basic structure is as follows.

This gallery:

Renders as:

and  modes add some additional structure around

Attributes to support (on the extension tag):
 * showfilename
 * caption
 * mode
 * widths
 * heights
 * perrow

Renders as:

A more involved example:

Renders as:

A showfilename example:

Renders as:

Editing support
All the extension attributes, except, need to be edited via data-mw.

Parsoid provides the raw extension body text in  and raw gallerycaption in   for clients to edit in a raw-text editor. If these data-mw properties are provided in the edited HTML, Parsoid uses that to generate serialized output for the extension. These properties should be removed from data-mw to enable serializing the HTML content instead.

As of December 2016, this HTML editing support should be considered experimental while we work with existing clients like VisualEditor to test the accuracy of this feature.