Page MenuHomePhabricator

Clicking section links from search results page adds HTML code / incorrect section to URL
Closed, DuplicatePublic

Description

A user messaged me in IRC to point out that he discovered that, when using the search tool, and clicking on a section inside of a result, it doesn't take you to the section that was clicked on - only the article. After asking him for some additional information, I'm filing this ticket with my findings.

Reproduction steps:

  1. While logged out (or in an incognito window), navigate to the English Wikipedia and enter "section numbering" into the search bar.
  2. Scroll down the results page and locate the result "Paragraph (section Numbering)" and click on the "Numbering" link.

The resulting URL that is given is **https://en.wikipedia.org/wiki/Paragraph#.3Cspan_class.3D.22searchmatch.22.3ENumbering.3C.2Fspan.3E** instead of //https://en.wikipedia.org/wiki/Paragraph#Numbering//

See this screenshot: https://i.imgur.com/tEtn0oC.jpg

I was also able to reproduce it each time with other searches, such as searching for "section plot" and clicking on the "Plot" URL in the "Newton (film) (section Plot)" result on the search results page. The URL linked to was **https://en.wikipedia.org/wiki/Newton_(film)#.3Cspan_class.3D.22searchmatch.22.3EPlot.3C.2Fspan.3E** instead of //https://en.wikipedia.org/wiki/Newton_(film)#Plot//

It seems that the search is inserting HTML span, class, searchmatch and other tags around the section portion of the URL while attempting to create the appropriate link to the result found.

Creating ticket to have this looked into and resolved.

Event Timeline

Oshwah created this task.Oct 25 2017, 2:07 PM
Restricted Application added a project: TCB-Team. · View Herald TranscriptOct 25 2017, 2:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript