Page MenuHomePhabricator

Mark red links
Closed, DuplicatePublic

Description

The app replaces red links with spans.

At a minimum we still need to be able to detect red links on the app side, so the app doesn't try to go to the page (or the link preview).
(We would also like to run this transformation on the Mobile Content Service instead of the clients.)

The problem is that there doesn't seem to be a way to detect red links with Parsoid output.

Red link example from Parsoid output of https://test.wikipedia.org/api/rest_v1/page/html/1977:

<a rel="mw:WikiLink" href="./2nd_millennium" title="2nd millennium">2nd<span typeof="mw:Entity"> </span>millennium</a>

Same link with mobileview[1]:

<a href=\"/w/index.php?title=2nd_millennium&amp;action=edit&amp;redlink=1\" class=\"new\" title=\"2nd millennium (page does not exist)\">2nd&#160;millennium</a>

The app looks for class new to detect red links.

[1] https://test.m.wikipedia.org/w/api.php?action=mobileview&format=json&formatversion=2&prop=text%7Csections%7Clanguagecount%7Cthumb%7Cimage%7Cid%7Crevision%7Cdescription%7Clastmodified%7Cnormalizedtitle%7Cdisplaytitle%7Cprotection%7Ceditable&onlyrequestedsections=1&sections=0&sectionprop=toclevel%7Cline%7Canchor&noheadings=true&page=1977&thumbsize=640

Event Timeline

bearND created this task.Nov 3 2015, 1:24 AM
bearND claimed this task.
bearND raised the priority of this task from to Needs Triage.
bearND updated the task description. (Show Details)
bearND added subscribers: Aklapper, bearND.
Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptNov 3 2015, 6:08 PM
Krenair added a subscriber: Krenair.Nov 3 2015, 6:13 PM
Rdicerb removed a subscriber: Rdicerb.