Last modified: 2014-02-22 00:00:38 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 T27470, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25470 - add {{#redirect}} parser function
add {{#redirect}} parser function
Status: NEW
Product: MediaWiki
Classification: Unclassified
Redirects (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-09 13:59 UTC by Kebap
Modified: 2014-02-22 00:00 UTC (History)
6 users (show)

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


Attachments

Description Kebap 2010-10-09 13:59:47 UTC
I just keep forgetting the correct syntax for a redirect, namely this:

#REDIRECT [[link]]

Now I wanted to find out more about this class of commands with this syntax starting with a # - but there are none except this? I was told, it is like this because Redirect preceded parser functions. If it was implemented now, it would probably be as a parser function, but out of tradition, mediawiki uses the above syntax.

I would now propose to also include a consistent syntax like this:

{{REDIRECT:link}} or {{REDIRECT:[[link]]} if needed

The old syntax is probably well-known and certainly widely spread, so it should also continue to work. However, it might be marked as deprecated, and the user documentation should maybe promote the more consistent syntax over the traditional one.

Otherwise I hope at least I wont forget the traditional syntax anymore after all this hustle.
Comment 1 Platonides 2010-10-09 14:02:44 UTC
You know that you can add it as a button in your toolbar, right?

(some wikis already have it there by default)
Comment 2 Max Semenik 2010-10-09 16:43:50 UTC
Any particualr reason this is needed? Consistency is good, but since we're not going to drop the back-compatible syntax, we'll be stuck with two alternative syntaxes forever. This is misleading.
Comment 3 MZMcBride 2010-10-09 17:21:38 UTC
(In reply to comment #2)
> Any particualr reason this is needed? Consistency is good, but since we're not
> going to drop the back-compatible syntax, we'll be stuck with two alternative
> syntaxes forever. This is misleading.

I don't have any objection to the idea in principle. The idea that a "#" followed by a magic word at the beginning of a page will produce a magic result is pretty arcane and senseless. Changing the syntax to something like {{#redirect:}} has plenty of merit in my mind.

Broadly, I think it would make sense to take a holistic approach rather than an incremental approach here, however. That is, if there are going to be (somewhat major) changes to syntax, they should be planned so that they can be consistent and sensible. For example, changing all magic words to be able to start with "#" (the subject of another bug). And it would be wise to look at other parts of wiki-syntax that could use improvement.

On the whole, I'd say this bug is worthy of further consideration.
Comment 4 John Mark Vandenberg 2014-01-26 09:41:25 UTC
Likewise I think this has merit.  Backwards compatibility is easy to achieve, and can be turned off by default for new wikis, or wikis which have finished migrating to the new syntax.  The syntax then becomes more consistent, and thus easier to document and learn, and build external parsers and editing tools.  There has been some large changes to the redirect functionality for 1.23 - maybe now is a good time to introduce this enhancement also.

https://gerrit.wikimedia.org/r/#/c/105829/

(Adding hash for all magic words would also be great)

There is also the fact that '#' is the syntax for lists, so the following becomes a list item instead of a redirect:
'<!-- Blah -->#REDIRECT [[Blah]]'

There are a lot of relevant comments on bug 14323.  To summarise, some are concerned that the syntax for redirect targets will become dynamic.  I'm not sure why that is inherently bad thing, but I recall that some magic words like {{CURRENTYEAR}} dont force updates to ripple through templates, and likely the same problem will exist in redirects if the redirect target could contain variables.  If redirects were a parser function, it can specify what is valid inside that function, and exclude expressions which would be valid within [[ ]].

If a redirect can be wrapped in a template (e.g. via a parser function), then bug 50878 is fixed.  New redirects could then be created by a VisualEditor transclusion of {{redirect to|<target>}} (deleted, but never worked afaik); existing redirects could be transformed to the new syntax before being presented to VisualEditor.
Comment 5 Technical 13 2014-02-21 22:49:57 UTC
What would it take to run a bot through the database to change all redirect pages from one syntax to the other, surely not a whole lot.  So, if the new formatting was added (and all the documentation properly updated to only show the new syntax) in one update, a bot runs through and converts all old usages to new, and in a subsequent update the old syntax is removed (people would catch on quick).  Then there would be no need to support multiple inconsistent ways...  Just a thought.
Comment 6 John Mark Vandenberg 2014-02-22 00:00:38 UTC
(In reply to Technical 13 from comment #5)
> What would it take to run a bot through the database to change all redirect
> pages from one syntax to the other ..
> .. Then there would be no need to support multiple
> inconsistent ways...  Just a thought.

Old revisions would still need to be displayed correctly, which means the old syntax would need to be understood by the page rendering logic.

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


Navigation
Links