Page MenuHomePhabricator

Update ApiQueryInfo to accept "is default caption" for linkclasses
Closed, ResolvedPublic

Description

In T392775, an ability to color links based on the link text was added (as opposed to just based on the target page). A proper code has been added to both the legacy parser and Parsoid.

The remaining place where this ability should be added is the ApiQueryInfo, which currently can determine the link color only based on the target page.

Acceptance criteria

  • When requesting the query+info API endpoint for a link [[User:~2025-1|~2025-1]], it's determined to have mw-tempuserlink class
  • When requesting the query+info API endpoint for a link [[User:~2025-1|user]], it's determined not to have mw-tempuserlink class

Minimally, the endpoint should support a single link to a given title (so that the result can still be keyed by the page title).

Details

Event Timeline

aaron triaged this task as Medium priority.Nov 25 2025, 2:41 AM
aaron moved this task from Incoming (Needs Triage) to Bugs & Chores on the MW-Interfaces-Team board.

As discussed in T392775#11406328 the Content-Transform-Team believes the correct solution is passing a boolean for 'has default link text', which would be a boolean option, for example indefaultlinktext so that the following would return appropriate link classes for [[User:cscott]]:

https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=info&titles=Main%20Page%7CUser%3Acscott&formatversion=2&inprop=linkclasses&inlinkcontext=Main%20Page&indefaultlinktext=1

I'll implement the proposed solution using the "default link text" concept.

Change #1212566 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/core@master] Support "is default link caption" in API query+info

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

Change #1212566 merged by jenkins-bot:

[mediawiki/core@master] Support "is default link caption" in API query+info

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

mszwarc renamed this task from Update ApiQueryInfo to accept link text for linkclasses to Update ApiQueryInfo to accept "is default caption" for linkclasses.Dec 15 2025, 11:25 AM
mszwarc closed this task as Resolved.
mszwarc updated the task description. (Show Details)