Page MenuHomePhabricator

Commons search for galleries and categories shows code in the results
Closed, DuplicatePublic

Description

The Wikidata Infobox (which I maintain) that is used in Commons categories and pages embeds the labels from all languages from the Wikidata item in the returned code to enable multilingual search on Commons. It is wrapped in nowiki to avoid it being shown on the page. However, search results sometimes show the multilingual labels, and the nowiki tag, for example at:
https://commons.wikimedia.org/w/index.php?title=Special:MediaSearch&search=Solar+eclipse+of+2024+April+8&type=page

This is also present in the older search:
https://commons.wikimedia.org/w/index.php?search=Solar+eclipse+of+2024+April+8&title=Special%3ASearch&profile=advanced&fulltext=1&ns0=1&ns6=1&ns12=1&ns14=1&ns100=1&ns106=1

The presence of the nowiki tag in particular is puzzling, since code doesn't normally show up in search results? Is there a way to avoid that?

The display of the other language content is unsurprising, though. If there's a better way of coding this in the Lua infobox code while still returning multilingual results, I'm happy to explore it.

Originally reported at https://commons.wikimedia.org/wiki/Template_talk:Wikidata_Infobox#Issue_with_Search_Feature_on_Wikimedia

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Is this substantially different from T331389? ("...<nowiki> output in search result descriptions")

Oops, I'd forgotten about the previous ticket, thanks for merging. Also apologies for accidentally changing subscribers, restoring those.