Page MenuHomePhabricator

<gallery> with |link=<external link> doesn't work on wikis with LanguageConverter
Closed, ResolvedPublic

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:58 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz52190.
bzimport added a subscriber: Unknown Object (MLST).

Change 76341 had a related patch set uploaded by Liangent:
LanguageConverter fixes to eliminate parser test failures

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

The root cause is that:

<gallery>
File:foobar.jpg|caption|link=http://google.com
</gallery>

is expanded to:
<gallery>
File:foobar.jpg|caption|link=<a rel="nofollow" class="external free" href="http://google.com">-{R|http://google.com}-</a>
</gallery>

and then the embedded | in the link text screws up the caption parsing.

What does -{R|...}- do? It doesn't seem to be documented at https://www.mediawiki.org/wiki/Writing_systems/Syntax

(In reply to comment #2)

The root cause is that:

<gallery>
File:foobar.jpg|caption|link=http://google.com
</gallery>

is expanded to:
<gallery>
File:foobar.jpg|caption|link=<a rel="nofollow" class="external free"
href="http://google.com">-{R|http://google.com}-</a>
</gallery>

and then the embedded | in the link text screws up the caption parsing.

What does -{R|...}- do? It doesn't seem to be documented at
https://www.mediawiki.org/wiki/Writing_systems/Syntax

https://www.mediawiki.org/w/index.php?title=Writing_systems/Syntax&diff=759781&oldid=667003

It's usually used in auto-generated -{ }- tags, in case some text already contains a pipe in it triggering other syntax.

Change 76341 had a related patch set uploaded (by Bartosz Dziewoński):
LanguageConverter fixes to eliminate parser test failures

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

Change 311849 had a related patch set uploaded (by C. Scott Ananian):
WIP: protect language converter markup in the preprocessor.

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

Change 76341 merged by jenkins-bot:
Protect -{...}- variant constructs in galleries

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

cscott claimed this task.