Content anchors (e.g. #cite_note5) points to Main_Page instead of current article
Closed, ResolvedPublic

Description

https://en.wikipedia.org/api/rest_v1/page/html/Hulk_Hogan

"Note 5" expands to https://en.wikipedia.org/wiki/#cite_note-5. It should expand to https://en.wikipedia.org/wiki/Hulk_Hogan#cite_note-5, or better yet, stay on the restbase page.

If it chooses to expand to a canonical Wikipedia view, it must also account for oldid when viewing older revisions. So the "base" url would be something like /wiki/Hulk_Hogen[?oldid=#] instead of /wiki/.

Krinkle created this task.Jun 11 2015, 4:02 PM
Krinkle updated the task description. (Show Details)
Krinkle raised the priority of this task from to Needs Triage.
Krinkle added a project: RESTBase.
Krinkle moved this task to Backlog on the RESTBase board.
Krinkle added a subscriber: Krinkle.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 11 2015, 4:02 PM

The link itself is correctly set in the source:

<a href="#cite_note-8" style="counter-reset: mw-Ref 8;">

However, it looks like the browser is simply concatenating that to:

<base href="//en.wikipedia.org/wiki/"/>

which makes me think this is a bug on the rendering side (i.e. the browser). Unfortunately both FF and Chromium do that.

GWicke set Security to None.

@mobrovac, I didn't follow your comment there. Can you clarify because this looks like a Parsoid bug actually.

ssastry triaged this task as High priority.Nov 17 2016, 10:32 PM
Krinkle updated the task description. (Show Details)
Krinkle removed a subscriber: Krinkle.
GWicke added a subscriber: GWicke.Nov 17 2016, 11:32 PM

The issue is the mis-match between the static base href & the relative hash href, as described by @mobrovac. The hash hrefs worked fine when we still used the path-relative links (using ../../ in page titles with slashes), but they don't work well with base href at /wiki/.

The issue is the mis-match between the static base href & the relative hash href, as described by @mobrovac. The hash hrefs worked fine when we still used the path-relative links (using ../../ in page titles with slashes), but they don't work well with base href at /wiki/.

Right, but, I was (am) confused by mobrovac stating this is a browser bug.

T72743: Parsoid base URL should be independent of page is the reason why we changed the base href, so, looks like we should update cite hrefs so they resolve properly.

I think this might be a render-side bug because the browsers just attach the anchor to the base href, but neglect to put in the actual path of the document. The work-around might be to complete the anchor with the page title, but IMHO this should not be necessary, as browsers should figure out themselves that they should simply attach the anchor to the current URL, not the base href.

Change 327863 had a related patch set uploaded (by Subramanya Sastry):
T102134: Fix cite hrefs to render properly

https://gerrit.wikimedia.org/r/327863

Change 327863 merged by jenkins-bot:
T102134: Fix cite hrefs to render properly

https://gerrit.wikimedia.org/r/327863

ssastry closed this task as Resolved.Jan 5 2017, 6:27 PM
ssastry claimed this task.