Page MenuHomePhabricator

Search results "eating" span tag contained in search preview
Closed, ResolvedPublic

Description

During the correction of Lint Errors on it.wiki, I noticed that the search strings including a "</span>" might generate wrong previews. For instance, if I make a search with "insource:/pagina di \'\'\'\[\[Aiuto\:Aiuto\|aiuto\]\]\'\'\'\.\<\/span\>/" (here is the link: https://it.wikipedia.org/w/index.php?title=Speciale:Ricerca&profile=all&search=insource%3A%2Fpagina+di+%5C%27%5C%27%5C%27%5C%5B%5C%5BAiuto%5C%3AAiuto%5C%7Caiuto%5C%5D%5C%5D%5C%27%5C%27%5C%27%5C.%5C%3C%5C%2Fspan%5C%3E%2F&fulltext=1&searchToken=8mklj71zqb959ugsrzrtwqtmw), the "</span>" isn't displayed in the previews. I've been told that this happens because of a "<span class="searchmatch">" wrapping each result, which gets closed by the tag in the result itself, that isn't consequentely displayed as expected. Is it possible to avoid this by preventing the matched text to be parsed as actual HTML?
Thanks.

EDIT: The search string I provided doesn't work anymore since every page with that error has been corrected. I can't find a string that will survive enough, but you can easily find one on your own: just make a search out of any "missing end tag" error with a faulty span and the error will pop up.

Event Timeline

Daimona created this task.Aug 12 2017, 10:55 AM
Restricted Application added projects: Discovery, Discovery-Search. · View Herald TranscriptAug 12 2017, 10:55 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Daimona updated the task description. (Show Details)
debt added a subscriber: debt.Sep 7 2017, 5:25 PM

@Daimona, can you create a page that is purposely broken so that we can take a look? Thanks!

@debt sure, I didn't create it before to avoid unintentional corrections. Now you can check the error on this sandbox of mine: https://it.wikipedia.org/wiki/Utente:Daimona_Eaytoy/Sandbox. All you have to do is check this link: https://it.wikipedia.org/w/index.php?search=insource%3A%2FThis+is+a+stripped+span%2F&title=Speciale:Ricerca&profile=all&fulltext=1&searchToken=92k96ri4whwxrom1qz2s3h8ba. As you can see, the stripped span is not displayed in the search result and this can be truly annoying, e.g. when looking for faulty spans. Thanks.

debt triaged this task as High priority.Sep 21 2017, 5:17 PM
debt edited projects, added Discovery-Search (Current work); removed Discovery-Search.

What it looks like (when broken):

Looks like this will be solved with T126563. Looking to see how hard that would be

Change 380564 had a related patch set uploaded (by EBernhardson; owner: EBernhardson):
[mediawiki/extensions/CirrusSearch@master] Stop eating <span> tags in highlighted output

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

Change 380564 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Stop eating <span> tags in highlighted output

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

debt closed this task as Resolved.Oct 2 2017, 2:09 PM