Last modified: 2013-07-04 10:34:40 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 T50081, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48081 - Parsoid: Relative internal wiki links show the wikitext rather than their traditional label
Parsoid: Relative internal wiki links show the wikitext rather than their tra...
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal minor
: ---
Assigned To: Gabriel Wicke
http://parsoid.wmflabs.org/mw/Outreac...
: easy
: 49919 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-04 18:06 UTC by James Forrester
Modified: 2013-07-04 10:34 UTC (History)
2 users (show)

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


Attachments

Description James Forrester 2013-05-04 18:06:19 UTC
The output of

  [[../Round 5/]]

(on MWwiki page Outreach_Program_for_Women/Round_6) is:

  <a rel="mw:WikiLink" href="../Outreach_Program_for_Women/Round_5/" data-parsoid="…">../Round 5/</a>

whereas the PHP parser output is:

  <a href="/wiki/Outreach_Program_for_Women/Round_5" title="Outreach Program for Women/Round 5">Round 5</a>

The contents of the <a> should be "Round 5" instead of "../Round 5/".
Comment 1 Gabriel Wicke 2013-06-20 23:40:58 UTC
*** Bug 49919 has been marked as a duplicate of this bug. ***
Comment 2 Krinkle 2013-06-20 23:46:35 UTC
The same for non-traversing relative links:

 [[/Round 5/]]
 becomes href="/Round 5/">/Round 5/</a>
 instead of href="/Round 5">Round 5</a>

In core the trick is that a relative url with a *trailing slash* and no custom label, will expand to linking to the page without the trailing slash and a label with both the leading and trailing slash removed (note that "Round/" and "Round" are both valid and *separate* MediaWiki pages. A wiki can have both.
Comment 3 Gabriel Wicke 2013-06-21 23:10:30 UTC
User documentation:
http://en.wikipedia.org/wiki/Help:Link#Subpage_links

Our implementation is in js/lib/ext.core.LinkHandler.js, which in turn uses resolveTitle in mediawiki.parser.environment.js for relative link resolution.
Comment 4 Gabriel Wicke 2013-06-21 23:17:23 UTC
Sorry, resolveTitle is only called implicitly when constructing a title. That will then only apply to the actual link, but not to the link text. I guess we could handle this in line 100 in the LinkHandler (in getWikiLinkTargetInfo, the relative link case) and update info.href accordingly. That will then be used to render the link text in case that is not explicitly specified.

Alternatively the stripping could also be a separate method that is called by renderWikiLink. Not sure if this should also apply to other namespaces. Can figure that out later, lets tackle regular wiki links first.
Comment 5 Gerrit Notification Bot 2013-06-23 20:32:55 UTC
Related URL: https://gerrit.wikimedia.org/r/70100 (Gerrit Change Ic5eb06b8b4992e5bcc97dceff0ab67d4ff356deb)
Comment 6 Gerrit Notification Bot 2013-07-02 22:54:02 UTC
Change 70100 merged by jenkins-bot:
Bug 48081: Fix relative internal wiki link labels

https://gerrit.wikimedia.org/r/70100
Comment 7 Andre Klapper 2013-07-04 10:34:40 UTC
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]

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


Navigation
Links