Page MenuHomePhabricator

External links in captions break images.
Closed, ResolvedPublic

Description

Author: grendelkhan

Description:
See linked page at
[[en:User:Grendelkhan/Scratch#External_links_in_captions_break_images]].

The following displays an image with a broken caption, and a spurious closing
bracket afterwards:

[[Image:Wiki.png|left|thumb|From [http://wikipedia.org Wikipedia]]]

Any space between the first and other two closing brackets causes the image not
to be displayed at all.

[[Image:Wiki.png|left|thumb|From [http://wikipedia.org Wikipedia], the free
encyclopedia.]]

This is a problem for articles like [[en:History of Arda]], which need to
provide credit and link-backs for the images they use. There is currently no way
to display external links in image captions unless bare links are used, or the
DIVs are manually written in. (The following works, for instance.)

[[Image:Wiki.png|left|thumb|From http://wikipedia.org]]


Version: 1.4.x
Severity: normal
URL: http://en.wikipedia.org/wiki/User:Grendelkhan/Scratch#External_links_in_captions_break_images

Details

Reference
bz1300

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:10 PM
bzimport set Reference to bz1300.

avarab wrote:

Actually it was only external links that closed immitiately before the image
link itself closed, like:

  • [[Image:Foo.png|thumb|[http://example.com]]] as opposed to
  • [[Image:Foo.png|thumb|[http://example.com].]] which worked.

I've fixed the issue in HEAD and REL1_4, thanks for the report.

Michael.Keppler wrote:

The bugfix is slightly buggy. The regexp in the parser which checks for the
existence of "]]]" (tripel closing bracket) needs an additional regexp modifier
"s" to also consume over newlines with the ".*" regexp part.

This will also fix bug #1905.

Michael.Keppler wrote:

patch for CVS

Attached:

Michael.Keppler wrote:

*** Bug 1905 has been marked as a duplicate of this bug. ***

avarab wrote:

Applied it to REL1_4 and HEAD, thanks.

avarab wrote:

Adding wikibugs-l@wikipedia.org as a CC (it was removed)