Page MenuHomePhabricator

Redirects aren't parsed before target extraction, breaks {{ns:}} and other stuff in redirects
Closed, ResolvedPublic

Description

Author: yury.tarasievich

Description:
Including the ns: namespace prefix in the #redirect argument breaks automatic redirection. E.g., the edit preview shows the redirect target in a numbered list item format, the template/page transclusion won't work etc.


Version: unspecified
Severity: enhancement

Details

Reference
bz15164

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:20 PM
bzimport set Reference to bz15164.
bzimport added a subscriber: Unknown Object (MLST).

Did you literally add "ns:" and expect it to work? In that case it's INVALID, because it isn't *supposed* to work. If you mean the "Talk:" or "User:" prefix by "ns:", that *is* a bug.

yury.tarasievich wrote:

Sorry, I mean 'ns name resolving' by the {{ns:}} construct, of course.

  • Redirecting to [[{{ns:category}}:catname]] doesn't work, as described, but redirecting to [[<localised category ns>:catname]] works.
  • Transclusion of template (which's a redirect to [[{{ns:template}}:tmplname]]) doesn't work, as described, but transclusion of template which's a redirect to [[<localised template ns>:tmplname]] works.
  • Redirecting to [[{{ns:0}}:textname]] doesn't work, but redirecting to [[textname]] works (of course :).

Generalizing summary. The issue is that redirects aren't parsed (so {{ns:template}} and other things aren't expanded) before figuring out what the redirect target is.

ayg wrote:

This is working as designed, they were never meant to resolve all this fancy stuff. Redirect resolution is currently a simple regex on the raw wikitext. Refiling as enhancement request.

  • This bug has been marked as a duplicate of bug 14323 ***

Is this really a duplicate of 14323? That bug seems to be specifically about parsing/displaying content outside the redirect line itself, whereas this bug seems to be about parsing the content/target of the redirect.