Page MenuHomePhabricator

The automatic <references/> list (when absent) should include an automatic heading above it
Open, Needs TriagePublic

Description

Automatically add a heading above the <references/> tag if references exist. The heading should be added to the TOC also.

I didn't find a way how to implement adding the heading if refs were used without a main references tag, because the code checks references when the wikitext was parsed and the TOC was already built. When I tried to use the InternalParseBeforeLinks hook instead of the ParserAfterParse hook in the CiteParserHooks class, it was working as expected but only for the simplest cases, but a lot of tests was not passed. I think it should be OK to have this feature disabled by default and it works with the <references/> tag only, at least to begin...

The patch


See Also:

Event Timeline

Is this just for a third party wiki or are you expecting it to be used on a WMF production wiki?

Aklapper renamed this task from Automatic headings to Automatically add heading above <references/> tag if references exist.Oct 17 2020, 5:36 PM
Aklapper updated the task description. (Show Details)

This was created for a third party wiki.

Krinkle renamed this task from Automatically add heading above <references/> tag if references exist to The automatic <references/> list (when absent) should include an automatic heading above it.May 11 2021, 8:34 PM

Automatically add heading above <references group=... /> tag if references exist.

Please make it at the group level. Maybe a simpler way to achieve it would be to hide the heading if the the references buffer is empty.

Eg.

<div display:none> ==References== <references group=... /> .... (if references list is empty) or

<div> ==References== <references group=... /> .... (if there are some references to show)

Change 633599 had a related patch set uploaded (by Vedmaka Wakalaka; author: Pastakhov):

[mediawiki/extensions/Cite@master] Automatic headings if references exist and $wgCiteHeading is true

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

@Pastakhov: Per emails from Sep18 and Oct20 and https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup , I am resetting the assignee of this task because there has not been progress lately (please correct me if I am wrong!). Resetting the assignee avoids the impression that somebody is already working on this task. It also allows others to potentially work towards fixing this task. Please claim this task again when you plan to work on it (via Add Action...Assign / Claim in the dropdown menu) - it would be welcome. Thanks for your understanding!