Page MenuHomePhabricator

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

Description

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 https://en.wikipedia.org/w/index.php?title=User:Thryduulf/sandbox2&oldid=565498603 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

Details

Reference
bz51893

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:04 AM
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 https://en.wikipedia.org/w/index.php?title=Typographer_%28typewriter%29&oldid=565431177

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: https://gerrit.wikimedia.org/r/#/c/43384/

This was a bit of a hacky support. More robust and improved support for this is coming in https://gerrit.wikimedia.org/r/#/c/83216/

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.