Last modified: 2014-02-21 20:09:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49646, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47646 - <gallery> handling of link parameter a bit odd
<gallery> handling of link parameter a bit odd
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.23.0
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-25 14:49 UTC by Bawolff (Brian Wolff)
Modified: 2014-02-21 20:09 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bawolff (Brian Wolff) 2013-04-25 14:49:35 UTC
Gallery handling of link parameter is a bit odd (presumably due to recursiveTagParsing and trimming things before splitting up by '|' instead of after).

Example:

<gallery>
Foo.jpg|link=http://somewhere.com|caption
</gallery>
Expected behaviour: Link to http://somewhere.com
Actual behaviour: Link to http://somewhere.com%2Ccaption

<gallery>
Foo.jpg|link=http://somewhere.com |caption
</gallery>
Expected behaviour: link to http://somewhere.com
Actual behaviour: it treats it as an internal link - http://mywiki.com/w/index.php/http://somewhere.com

-----

I suppose if we changed this we would have to be careful over breaking back-compat(?). In particular the whole recursiveTagParse thing probably means someone is using {{!}} to split up components.
Comment 1 Jesús Martínez Novo (Ciencia Al Poder) 2013-12-26 16:07:12 UTC
I'm going to add to this bug other oddities with the link= parameter in galleries (I'm not sure if it should be split, but seemed related):

* External links with ampersands get the ampersands double-HTML-escaped: the link has the & converted to &amp; when you open it, the HTML source is "&amp;amp;"

  File:Foo.jpg|link=http://example.com/?param1=1&param2=2
  Is rendered with a link to http://example.com/?param1=1&amp;param2=2

* Internal links with an anchor: The anchor is stripped from the link:

  File:Foo.jpg|link=Article#Anchor
  Is rendered with a link to Article

Test case: https://www.mediawiki.org/w/index.php?oldid=849650
Comment 2 Jesús Martínez Novo (Ciencia Al Poder) 2013-12-26 16:19:19 UTC
Bumping importance & priority to normal, since for issues in comment 1 there are no workarounds (workaround for comment 0 is to leave the link= parameter at the end). Maybe it would make sense to split it, but I'm not sure if it's something specific to galleries or more general as Bawolff suggests
Comment 3 Quim Gil 2014-02-21 20:07:30 UTC
Also, it would make sense to expect that "link=" removes the link from the image just as it does in regular image links. However, the link persists.

I can file a separate bug about this, if that helps.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links