Page MenuHomePhabricator

Anchor links are not helpful on diff view.
Closed, ResolvedPublic

Description

Hi.

The thing is that anchor links on diff view have a href like
href="/wiki/User:Nux/test#A_section" which is good only on history page and
such. When I actually compare two version e.g.:
http://test.wikipedia.org/w/index.php?title=User%3ANux%2Ftest&diff=9418&oldid=9417
I would expect a section link to simply point me down to the section and not
reload a page to latest version on which this section might have been already
removed.

The solution would be to simply construct links like this:
href="#A_section"

If someone actually use those links on pages like village pump, then fixing this
bug might actually reduce server load.


Version: unspecified
Severity: normal
URL: http://test.wikipedia.org/w/index.php?title=User%3ANux%2Ftest&diff=9418&oldid=9417

Details

Reference
bz7688

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:27 PM
bzimport set Reference to bz7688.
bzimport added a subscriber: Unknown Object (MLST).

Oh and by "section link" I mean something like: "(→A section)"

Linker::formatComment() produces the section autocomment links; since most such are displayed on Recent Changes or
history views, the link includes the destination page's full URL.

It might be useful to be able to pass another parameter to indicate that the rendered text appears on the page below so a
local anchor link can be made.

fyrenmoo wrote:

Patch that does what Brion suggested.

Added a $local parameter that trickles down from Linker::revComment ->
Linker::commentBlock -> Linker::formatComment. Doesn't break anything on my
test wiki, at least!

Attached:

ayg wrote:

Committed in r17741, with a modification: the section link in the "old" diff
summary may not refer to a valid section (could have been removed in the
interim), so the new behavior affects only the "new" diff summary.

rotemliss wrote:

(In reply to comment #4)

Committed in r17741, with a modification: the section link in the "old" diff
summary may not refer to a valid section (could have been removed in the
interim), so the new behavior affects only the "new" diff summary.

I think you changed it 17742, and applied it to the "old" summary as well.

ayg wrote:

Correct, I did do that in r17742, I was just too lazy to note it here. :D

ayg wrote:

*** Bug 5080 has been marked as a duplicate of this bug. ***