Last modified: 2011-07-20 03:07:20 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 T31926, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29926 - request a delink or debracket magic word
request a delink or debracket magic word
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-16 21:51 UTC by Gustronico
Modified: 2011-07-20 03:07 UTC (History)
2 users (show)

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


Attachments

Description Gustronico 2011-07-16 21:51:59 UTC
Problem:
In template tags, parameter values sometimes are linked and sometimes are not.
Inserting those values into double brackets (in template code) may conduce to four-bracketed links. In the other hand, not inserting them into brackets may conduce to 0-bracketed not-linked titles.

Proposal:
Add a new "delink" function that eliminates internal-linking double brackets.
* {{delink:[[Title]]}} &arr; Title
* {{delink:Title}} &arr; Title
* {{delink:[external link]}} &arr; [external link]

And possibly a "link" counterpart.
* {{link: [[foo]] }} &arr; [[foo]]
* {{link: foo }} &arr; [[foo]]
* {{link: [external] }} &arr; [external]

It should also be very useful for parameter comparison:
{{#ifeq: {{delink: {{{1}}} }} |my title|yes|no}}

An alternative (or additional) option to help bypass the problem could be to introduce a overall wikitext conversion of four brackets into two, wherever it occurs:
* [[[[ &arr; [[
* ]]]] &arr; ]]

comments? Gustavo
Comment 1 Brion Vibber 2011-07-19 16:44:20 UTC
I would recommend just getting the template straight -- figure out what format it takes, and use that. Be consistent; if you see errors, edit and fix them.
Comment 2 Gustronico 2011-07-19 20:15:12 UTC
(In reply to comment #1)
I agree about getting the template straight: In a given field, values must sometimes be showed as links and sometimes not, and that condition is defined in tags. It's ok. Now suppose you pretend evaluate that bunch of values to gate another condition, not simple *to show* them.

Handling and comparison of already-linked parameters are sometimes necessary. Just see these unexpected results with pagenames parser functions:

*{{TALKPAGENAME: [[Foo]] }} →               (expected Talk:Foo)
*{{#ifexist: [[Piano]] |yes|no}} → no       (expected yes)
*{{NAMESPACE:[[Help:Bar]]}} →               (expected Help)
  
Brion: Please consider adding automatic delinking capability to all parser functions instead, proved that the parameter is a whole and unique link (ie. not a string with some portions linked).

I'll enter this as a different bug.
Comment 3 Gustronico 2011-07-20 03:07:20 UTC
(In reply to comment #1) 
> figure out what format it takes, and use that. Be consistent; if you see
> errors, edit and fix them.
(and in reply to bug 29970#c1)
> Again I recommend correctly factoring the template & template parameters to
> begin with.

Brion, you do not seem to think so about {{lc:}} and {{uc:}}. What's the main and wider use of those functions? It's to normalize and facilitate comparison of parameters, isn't it?
{{#ifeq: {{lc:{{{1}}}}} | foo |yes|no}} is more effective that a simple
{{#ifeq: {{{1}}} | foo |yes|no}}

Same happens here:
{{#ifeq: {{delink:{{{1}}}}} | foo |yes|no}} will be more effective that a simple
{{#ifeq: {{{1}}} | foo |yes|no}}

I can't see the condition that makes this function invalid. As any other function, it should be used where is needed and being consistent, of course.

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


Navigation
Links