VisualEditor: Page content not rendered after unclosed <center> tag in image caption of non-thumbnails
Closed, ResolvedPublic


When an image file is included directly in an article (i.e not as a thumbnail and not in a frame) with an unclosed <center> tag in the caption causes Visual Editor to not render any page content after the image.

See for an example.

All the following conditions must be true to see this bug:

  • Image must not be a thumbnail or in a frame
  • The image caption must contain an unclosed html tag specifying text alignment in the caption. Tested with <center>, <p align="center"> and <div align="right">
  • The image placement (left, right or center) must be specified

The bug does not occur with an unclosed italic html tag. I haven't tested with other tags.

Version: unspecified
Severity: normal


bzimport set Reference to bz51893.

Forgot to note that although this combination of conditions is presumably uncommon, it was first observed in the wild at

Unclosed tags in image caption is not that infrequent unfortunately -- the difference between <center> and <i>/<b> tags is that the former is a block tag and the latter is an inline tag. So, any other block tag that is unclosed will cause the same issue.

That said, I am surprised that this problem showed up in the first place since Parsoid has had support to deal with unbalanced tags for a long time:

This was a bit of a hacky support. More robust and improved support for this is coming in

So, unsure what happened here with this bug.

Will provisionally mark this as in-review, then (you can see that it's still happening with production Parsoid, though that may be cache errors).

As we discussed and confirmed on IRC, this is not happening in production right now. So, I am going to mark this resolved-fixed. Please reopen if a similar error shows up.

Add Comment