Page MenuHomePhabricator

VisualEditor: Wikitext warning not triggered when editing image captions, references
Closed, ResolvedPublic


Wikitext added to image captions is nowikied in the same way that markup added to the page body is. e.g. however the wikitext warning is not generated.

To reproduce:

  1. Load any page with an image in VE
  2. Edit the image caption
  3. Add any wiki markup in the caption (tested with bold, italic and links)

Expected behaviour: The wikitext warning pops up.
Action behaviour: Nothing happens

If popping up the warning while in the image caption dialog is not possible, then it should do so immediately the dialog is closed. Displaying it at the same time would be preferable though.

Version: unspecified
Severity: minor
See Also:



Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:39 AM
bzimport set Reference to bz56213.

I started looking at this. It's annoying because the code to do the wikitext detection is already there and working for the main surface. It would be trivial to do the absolutely wrong way (i.e. copy the existing code to the reference surface or image caption surface and just change the reference to the Surface object), but it's a pain to fix the proper way.

One of the problems lies in the differences between normal surfaces (i.e. the main one) and surface widgets. It was suggested that we could implement MWSurfaceWidget which does the wikitext warning, but the main surface is not a widget and would still need it's own version of the code.

Also, we can't just shove the wikitext detection code in the ve.ui.Surface class and guard it with some config, because the Surface code lives in VE core which does not deal with MediaWiki features (wikitext) - the VE MediaWiki extension deals with that.

Roan suggested we could make the main surface be a surface widget and then create an MWSurfaceWidget, but that apparently has issues involving toolbar floating (I'm not familiar with this, perhaps it could be fixed in some way).

I think that for now, we can probably change the wikitext detection function to accept a surface parameter, then make it static somewhere and have each wikitext-free surface to set up an event handler for it.

Change 138761 had a related patch set uploaded by Alex Monk:
Show wikitext warnings in the reference dialog

Change 138761 merged by jenkins-bot:
Show wikitext warnings in the reference and media caption dialogs