* In #minervaneue, https://phabricator.wikimedia.org/diffusion/SMIN/browse/master/resources/skins.minerva.scripts/references.js refers to a ReferencesHtmlScraperGateway.
* Note: Before https://phabricator.wikimedia.org/rSMINd1cd5588215122fb9c45490fffdfa437fa2eae68, two possible sources for references existed, the other one (called "LazyLoadReferences") utilizing the #restbase endpoint. This was not used any more, and finally dropped mid 2019.
* In #mobilefrontend, https://phabricator.wikimedia.org/diffusion/EMFR/browse/master/src/mobile.startup/references/ReferencesHtmlScraperGateway.js fetches a DOM element from the page. This is probably what needs to be expanded to take sub-referencing into account.
The idea is to show the parent along with the sub-reference, so the user can understand the structure. This is the same issue and proposed solution as {T239228} for the #reference_previews feature.
Here's an example screenshot of a [[ https://de.wikipedia.beta.wmflabs.org/wiki/Faultier | test page ]] with an opened preview popup for a subreference:
{F31519418}