Page MenuHomePhabricator

Replies with <gallery>...</gallery> tags do not render in preview properly
Closed, ResolvedPublic

Description

As first reported here: Usability test: Version 1.0 prototype, comments with <gallery>...</gallery> tags do not render in the reply preview properly.

Expected behavior

Actual behavior

Steps to reproduce

  1. Go to: https://en.wikipedia.beta.wmflabs.org/wiki/Talk:Cats
  2. Click any "Reply" link, regardless of how deeply it is indented
  3. Input the "Snippet" below into the reply text input

⚠️4. Preview shows images in a bulleted list instead of in a gallery, as shown in "Expected behavior" above

Snippet

<gallery>
File:Detroit Publishing Co. - A Yeoman of the Guard (N.B. actually a Yeoman Warder), full restoration.jpg|1
File:Official_program_-_Woman_suffrage_procession_March_3,_1913_-_crop.jpg|2
File:Thurston, the famous magician - East Indian Rope Trick.jpg|3
File:Joseph Ferdinand Keppler - The Pirate Publisher - Puck Magazine - Restoration by Adam Cuerden.jpg|4
</gallery>

Event Timeline

ppelberg created this task.Dec 20 2019, 1:04 AM
JJMC89 renamed this task from Replies wrapped in <gallery>...</gallery> tags do not render in preview properly to Replies with <gallery>...</gallery> tags do not render in preview properly.Dec 20 2019, 3:55 AM
JJMC89 updated the task description. (Show Details)
JJMC89 added a subscriber: JJMC89.Dec 20 2019, 3:58 AM

This bug also happens for other things that use the results of the parse API to create previews, including the wikEd gadget.

You need to add modules to the prop parameter. Then the result will contain something like "modulestyles": ["mediawiki.page.gallery.styles"], which is the module you need to load to get the missing CSS.

matmarex claimed this task.Jan 2 2020, 2:52 PM

(This works on https://visualeditor-prototype.wmflabs.org/wiki/Talk:Reply_test because that page already contains a <gallery> tag, so the necessary styles are already loaded.)

Change 561659 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] ReplyWidget: Load modules required by the content when previewing

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

Change 561659 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] ReplyWidget: Load modules required by the content when previewing

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

ppelberg closed this task as Resolved.Feb 11 2020, 12:54 AM