Page MenuHomePhabricator

Improve rendering of section links
Open, LowestPublicFeature

Description

Author: contactbox

Description:
Wikilinks containing a section reference are not rendered nicely; they are
rendered as written unless the editor who added the link also adds a nice
format for it too. But in this case, the appearance is non-standard which
is also not ideal. This is an example of the problem, consider the
appearance which a link such as this will be given to a reader:

[[Principles of NLP#Stated purpose of NLP]]

Taking this as an example, I suggest the mediawiki engine performs a
standard rendering of wikilink sections as follows:

Article and section: [[Principles of NLP#Stated purpose of NLP]]
Rendered as one of:

Principles of NLP: Stated purpose of NLP
Principles of NLP [section: Stated purpose of NLP]

Section only: #Stated purpose of NLP
Rendered as one of:

(section) Stated purpose of NLP
(ibid) Stated purpose of NLP

Version: unspecified
Severity: enhancement

Details

Reference
bz3833

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 8:55 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz3833.
bzimport added a subscriber: Unknown Object (MLST).

ui2t5v002 wrote:

I like all of those except "ibid".

michael wrote:

Section links are also not reflected in the link's title attribute, so there is no tool-tip indicating the precise
destination. This is especially noticable in same-page links, which have a blank title.

I would like to see something like "Principles of NLP: Stated purpose of NLP" in a section link, and
especially something like "Jump to 'Stated purpose of NLP' on this page" for same-page links.

michael wrote:

Note that rendering titles for section links would also render them for editor-created anchors, like
footnotes and references.

Adding complexity to the parser? Not a good idea.

(In reply to comment #4)

Adding complexity to the parser? Not a good idea.

This is not a valid reason to resolve a bug as "wontfix." Re-opening.

Nemo_bis set Security to None.
Nemo_bis subscribed.

Note, the WebAPI is already able to list section titles of a page; I don't remember if also of multiple pages at once. https://www.mediawiki.org/wiki/API:Parsing_wikitext

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:02 AM
Aklapper removed a subscriber: wikibugs-l-list.