Page MenuHomePhabricator

Reference Tooltips gadget needs tweaking for Parsoid HTML
Open, Needs TriagePublic

Description

See discussion at T358242#9732015.

The gadget renders a bit differently with the "^" and "named reference backlinks" also showing up in the tooltip when used on a page with Parsoid HTML

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tacsipacsi subscribed.

Reference Previews is the extension (which was fixed in T358242), not the gadget.

So the current parser has this markup for references:

<ol class="references">
  <li>
    <span class="mw-cite-backlink">
      <b><a aria-label="Jump up" title="Jump up">^</a></b>
    </span>
    <span class="reference-text">...</span>
  </li>
  ...
</ol>

(When there are multiple backlinks, <b><a>...</a></b> elements wrap individual backlinks.)

Whereas Parsoid has this markup for references:

<ol class="mw-references references" typeof="mw:Extension/references">
  <li>
    <a rel="mw:referencedBy"><span class="mw-linkback-text"></span></a>
    <span class="mw-reference-text">...</span>
  </li>
  ...
</ol>

(When there are multiple backlinks, [rel="mw:referencedBy"] becomes <span> and links wrap .mw-linkback-text.)

Do I understand correctly that Parsoid's markup isn't gonna change? Or perhaps it is Cite that uses new markup for Parsoid? Don't see anything about it on https://www.mediawiki.org/wiki/Parsoid/Known_differences_with_Core_Parser_output.

(Note the absence of accessibility markup in Parsoid's output, btw. Definitely not ready for production in that respect.)

T328695: Parsoid's Cite output could break gadgets, bots, user scripts is related -- we haven't fully settled on the tweaks we might make. We hope to take it up soonish once we resolve all blockers for enwikivoyage. .But, that task was created because of the JS that adds those accessibility attributes didn't kick in. While it was easy to fix that JS, we stopped to think about what else might be affected.

I'll update here / there once we finalize those details -- feel free to leave your thoughts there as well. But, we expect some gadgets will still need tweaking.