Page MenuHomePhabricator

Modify link text on group references e.g to remove blank
Open, LowPublicFeature

Description

Author: csvfiles

Description:
Links to references on a group are created with the group name on them as [<groupname><blank><number>] (or in HTML, a link to the first reference to a group called "C" will be created as <sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[C 1]</a></sup>)

I would like to be able to modify the way the link is generated (e.g to make [C 1] into [C1] to make references smaller, or into [C&nbsp;1] so the reference is not split up between lines)

The <sup> link is generated through the MediaWiki:cite_reference_link configuration page. The "C 1" part is the parameter $3. Note the blank between the group name (C) and the number of the reference (1).

On "Cite_body.php" there is a function named "linkRef" which calls this page and passes the three parameters it requires. The $3 is passed as:

"$this->getLinkLabel( $label, $group, ( ( $group == CITE_DEFAULT_GROUP ) ? '' : "$group " ) . $wgContLang->formatNum( $label ) )"

I'm afraid the blank space in my "[C 1]" reference is hardcoded in this line. Can this be made into another parameter page, please?


Version: unspecified
Severity: enhancement

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:53 AM
bzimport added a project: Cite.
bzimport set Reference to bz53794.
bzimport added a subscriber: Unknown Object (MLST).

Regarding zhwiki, a space is needed if $group[-1] is alphanumeric (otherwise [foo_999 1] -> [foo_9991]). Some simple "change-the-blank-string" config will not be enough for this.

Regarding zhwiki, a space is needed if $group[-1] is alphanumeric (otherwise [foo_999 1] -> [foo_9991]). Some simple "change-the-blank-string" config will not be enough for this.

A group name ended with number is rarely seen. Nevertheless it's still a possibility and should be taken care.

What jimmyxu means is that an extra optional parameter is needed, such that the end user in zhwiki may choose to suppress the space. Currently users in zhwiki, no matter directly call {{#tag:ref|group=groupname}} or use templates such as Template:Refn, have no way to get rid of the space, hence violating the MOS guideline in zhwiki.

Quest_for_Truth raised the priority of this task from Low to High.Aug 6 2016, 6:42 PM
Aklapper lowered the priority of this task from High to Low.Aug 7 2016, 12:39 PM

@Quest_for_Truth: You increased the priority of this task.
As priority reflects reality and does not cause it, could you please elaborate why this task has suddenly become more urgent?
If you increased priority because you plan to work on this task (thanks!) please claim the task by setting yourself as assignee. Thank you for your help!

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:13 AM

Regarding zhwiki, a space is needed if $group[-1] is alphanumeric (otherwise [foo_999 1] -> [foo_9991]). Some simple "change-the-blank-string" config will not be enough for this.

That is overdoing. Actually, the whitespace character needs to be removed only if the reference group name matches /\p{Han}$/ (this regex works for PHP [both PCRE and PCRE2] but not JavaScript). I personally suppose that this should work without any extra parameter in Chinese projects.

Change 937059 had a related patch set uploaded (by 沈澄心; author: 沈澄心):

[mediawiki/extensions/Cite@master] Add 'space' option to ref tag

https://gerrit.wikimedia.org/r/937059

Change 937435 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] [POC] No space between Chinese group name and number

https://gerrit.wikimedia.org/r/937435

Change 937059 abandoned by 沈澄心:

[mediawiki/extensions/Cite@master] Add 'space' option to ref tag

Reason:

https://gerrit.wikimedia.org/r/937059

Change 937435 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/Cite@master] [POC] No space between Chinese group name and number

Reason:

https://gerrit.wikimedia.org/r/937435