Page MenuHomePhabricator

Parsing example queries partially produce errors
Open, Needs TriagePublic

Description

It seems that some queries parsed from https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples are not displayed correctly on the example pop-up on https://query.wikidata.org/ : when opening an example query, the # of the code lines are displayed inside the query code, which makes it fail.

Steps to reproduce:

  • Go to https://query.wikidata.org/
  • Click on the "Examples" button
  • type "lexeme" in the filter box and pick any of the suggested queries
  • look at the query code: numbers appear at the beginning of each line

Screenshot from 2020-12-16 15-50-52.png (243×726 px, 45 KB)

I noticed this for the first time on December 16th, but I'm not sure since when it's broken.
Not all examples are affected, the ones at the beginning of the list (eg cats) work correctly.

Questions:

  • Where does it come from? Is it an issue in the WDQS UI or with the templated used on the wikipage?

Event Timeline

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

Pinging @Tagishsimon since it seems that you discovered this issue a few days ago. Is it already reported somewhere else?

The template itself hasn't changed recently so a template enclosed in this template is probably at issue here.

According to https://web.archive.org/web/20190205051545/https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples
previously, syntaxhighlight markup looked like:

<span class="lineno"> 1 </span><span class="c">#defaultView:BarChart</span>

Line numbers were not selectable.

Now generated html looks like:

<span class="linenos"> 1</span><span class="c"># See also the SPARQL manual</span>

The worst part (despite that some external tools were broken) that now when you select code block, line numbers are selected and copied too.

Lineno were renamed to linenos in https://github.com/wikimedia/mediawiki-extensions-SyntaxHighlight_GeSHi/commit/d2e9809554b6bc239f5964c881c29d7548e6018c
@ori