Page MenuHomePhabricator

VE/Preview broken for simple image markup
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Start a new topic at e.g. https://www.mediawiki.org/wiki/Talk:Flow
  2. Click </> to switch to wikitext mode and type in "[[File:Example.jpg|thumb]]"
  3. Click </> again to switch back to visual editing mode. (The image displays fine.)
  4. Click </> once again to switch to wikitext mode.

Result: The source has changed to "[[null|thumb|link=|alt=null|[[File:Example.jpg|link=|220x220px]]]]", and correspondingly the image displays with an extraneous "thumb|link=|alt=null|" next to it when switching back to the visual mode once again.

Event Timeline

Tbayer raised the priority of this task from to Needs Triage.
Tbayer updated the task description. (Show Details)
Tbayer added a subscriber: Tbayer.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Mattflaschen-WMF renamed this task from Dirty diff for [[File:...|thumb]] to Preview broken for simple image markup.Aug 29 2015, 12:26 AM
Mattflaschen-WMF renamed this task from Preview broken for simple image markup to VE/Preview broken for simple image markup.
Mattflaschen-WMF claimed this task.
Mattflaschen-WMF triaged this task as Unbreak Now! priority.
Mattflaschen-WMF updated the task description. (Show Details)
Mattflaschen-WMF set Security to None.
Tbayer updated the task description. (Show Details)Aug 29 2015, 12:57 AM

Parsoid DOM for images isn't valid HTML or something. Need to use VE-MW's image code which copes with this.

Change 234709 had a related patch set uploaded (by Catrope):
Load mwimage support in VE

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

Change 234709 merged by jenkins-bot:
Load mwimage support in VE

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

Checked in betalabs - after inserting &saving [[File:Example.jpg|thumb]] - the display is fine.

<div class="flow-post-content">
		<figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid="{&quot;optList&quot;:
[{&quot;ck&quot;:&quot;thumbnail&quot;,&quot;ak&quot;:&quot;thumb&quot;}],&quot;dsr&quot;:[0,26,2,2]}">
<a href="http://en.wikipedia.beta.wmflabs.org/wiki/./File:Example.jpg" data-parsoid="{&quot;a&quot;:
{&quot;href&quot;:&quot;./File:Example.jpg&quot;},&quot;sa&quot;:{},&quot;dsr&quot;:[2,24,null,null]}">
<img resource="./File:Example.jpg" src="//upload.beta.wmflabs.org/wikipedia/commons/a/a9/Example.jpg" data-file-width="172" 
data-file-height="178" data-file-type="bitmap" height="178" width="172" data-parsoid="{&quot;a&quot;:
{&quot;resource&quot;:&quot;./File:Example.jpg&quot;,&quot;height&quot;:&quot;178&quot;,&quot;width&quot;:&quot;172&quot;},&quot;sa&quot;:{&quot;resource&quot;:&quot;File:Example.jpg&quot;}}">
</a>
</figure>
	</div>
DannyH closed this task as Resolved.Sep 1 2015, 5:17 PM
DannyH added a subscriber: DannyH.
Elitre added a subscriber: Elitre.Sep 10 2015, 5:43 AM