Page MenuHomePhabricator

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


Event Timeline

@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


  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 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

(I discovered T167933 while working on this.)

Deskana triaged this task as Medium priority.Jun 15 2017, 1:02 PM
Deskana moved this task from To Triage to TR1: Releases on the VisualEditor board.
Jdforrester-WMF set the point value for this task to 1.

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