Page MenuHomePhabricator

Parsoid occasionally serialises new images as figure class="default size" inserted in a caption
Closed, ResolvedPublic0 Estimated Story Points

Event Timeline

Jdforrester-WMF raised the priority of this task from to Medium.
Jdforrester-WMF updated the task description. (Show Details)

This looks to me like a VE bug -- it looks like somehow VE is generating something very similar to:

<figure class="mw-default-size" role="presentation">[./File:Tara_ghrah.jpg <img src="//upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Tara_ghrah.jpg/220px-Tara_ghrah.jpg" width="220" height="165" resource="./File:Tara_ghrah.jpg" alt="village view " data-file-width="720" data-file-height="540" data-file-type="bitmap" role="presentation" />]<figcaption href="Category:All articles lacking sources">tara garh</figcaption></figure>

instead of (what I'd expect):

<figure typeof="mw:Image" class="mw-default-size">
 <a href="./File:Tara_ghrah.jpg">
  <img resource="./File:Tara_ghrah.jpg " src="//upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Tara_ghrah.jpg/220px-Tara_ghrah.jpg"
       width="220" height="165">
 </a>
 <figcaption>tara garh</figcaption>
</figure>

In particular:

  • The typeof the <figure> tag is missing.
  • The <a> tag underneath <figure> may be missing (although possibly it is being serialized as an external link, leading to the [./File:Tara_ghrah.jpg ...] in the wikitext.
  • The <figcaption> has an href attribute -- this ought to be ignored, and thus harmless, but note that the href *also* appears to have an unescaped colon.
  • Dunno where all the role="presentation" are coming from, but they should be harmless.

I'm guessing the first of these (the missing typeof) is actually the root cause. The href in the figcaption might hint that category tags in the caption might be involved somehow? But I'm pretty certain that what we're seeing is Parsoid attempting to do its best to render bogus HTML given to it. I could be wrong, of course.

Arlolra claimed this task.
Arlolra subscribed.

Please reopen if there're still cases of this bug.