Page MenuHomePhabricator

VisualEditor tooltip incorrectly parses names of multiline templates
Closed, ResolvedPublic1 Story Points

Description

Event Timeline

FDMS created this task.Jun 11 2017, 8:45 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 11 2017, 8:45 PM

@FDMS I'm new at this, so it's not clear to me what's going on here. Please can you add to this bug:

  • The specifics steps to reproduce the problem
  • What you would expect to happen
  • What actually happens

Thanks!

FDMS added a comment.EditedJun 12 2017, 3:26 PM
  1. Go to any file page that has the default infobox template on it (e.g. File:Berninabahn zwischen Lagalb und Ospizio Bernina im Winter.jpg)
  2. Open VisualEditor on that page
  3. Hover over the infobox template and wait for the template tooltip

Expected behaviour: The template's name, "information", should be displayed.
Actual behaviour: The template's name plus a linebreak are displayed.

(This can also be reproduced with Wikipedia infoboxes or any other templates usually occupying more than one source wikitext line.)

matmarex claimed this task.Jun 14 2017, 9:57 PM
matmarex added a subscriber: matmarex.

The root cause of this is that mw.Title.newFromText() doesn't accept input containing newlines (which is correct and matches PHP Title::newFromText()), so the template name is not formatted prettily. We should be stripping any leading/trailing newlines before.

Change 359074 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Use Parsoid data for template names rather than detect from wikitext

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

(I discovered T167933 while working on this.)

Deskana triaged this task as Normal priority.Jun 15 2017, 1:02 PM
Deskana moved this task from To Triage to TR1: Releases on the VisualEditor board.
Jdforrester-WMF closed this task as Resolved.Jun 21 2017, 1:04 AM
Jdforrester-WMF set the point value for this task to 1.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptJun 21 2017, 1:04 AM

Change 359074 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Use Parsoid data for template names rather than detect from wikitext

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