Page MenuHomePhabricator

Hovercards loses manual superscript formatting by requesting plain text
Closed, DuplicatePublic

Description

The articles w:en:Googol and w:en:Googolplex include a <sup>foo</sup> string, which is not correctly displayed in Hovercards.

Related Objects

Event Timeline

Quiddity created this task.Sep 10 2015, 6:05 PM
Quiddity updated the task description. (Show Details)
Quiddity raised the priority of this task from to Needs Triage.
Quiddity added a subscriber: Quiddity.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 10 2015, 6:05 PM

Hovercards makes a request for https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts%7Cpageimages%7Crevisions&formatversion=2&redirects=true&exintro=true&exsentences=5&explaintext=true&piprop=thumbnail&pithumbsize=300&rvprop=timestamp&titles=Googol&smaxage=300&maxage=300&uselang=content

The directive explaintext tells TextExtracts to return extracts as plain text instead of limited HTML... so this is doing exactly what it should. Hovercards should probably request HTML.

Jdlrobson renamed this task from Add support for manual superscript formatting to Hovercards or TextExtracts to Hovercards loses manual superscript formatting by requesting plain text.Sep 18 2015, 8:23 PM
Jdlrobson removed a project: TextExtracts.
Jdlrobson set Security to None.
Jdlrobson triaged this task as Normal priority.

… Hovercards should probably request HTML.

What would be the implications of doing this? Are there elements known to be in the initial excerpt that are sure to mess up the Hovercard?

Potentially. We'd need to explore it. I'd expect that we'd need to parse the output into a DOM tree and whitelist only a few images e.g. p tags, sub, and sup.

I'd suggest to implement this we'd try a different mode e.g. explainhtmlsubset and test out on mobile first.

dr0ptp4kt lowered the priority of this task from Normal to Low.Aug 4 2016, 3:35 PM
dr0ptp4kt moved this task from To Triage to Triaged but Future on the Readers-Web-Backlog board.

Related to (loading plain text instead of HTML):

should we track tasks like this under one task?