Page MenuHomePhabricator

mw.util.addSubtitle should accept jQuery objects
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):
I'd like the mw.util.addSubtitle function to accept jQuery objects for the parameter instead of just HTMLElement and HTMLString.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
See https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Subtitle_and_jQuery,_again. jQuery is a very convenient library for element manipulation, and to maintain maximum possible subtitle compatibility with this function, one needs to use workarounds that have downsides.

Benefits (why should this be implemented?):
It would be much easier to add a subtitle that's also a jQuery element without querying the entire DOM.

(Not sure if the tag I added is the right one, but it's what's used for T316830)