To reproduce the problem:
- Navigate to https://www.wikidata.org/wiki/Q1021880
- Scroll down to elevation above sea level
- Click the triple-dot link
SPARQL-QUERY: queryStr=SELECT ?item ?label ?_image WHERE { ?item wdt:P2044 "4 <span class="wb-unit">metre</span>". SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . ?item rdfs:label ?label } OPTIONAL { ?item wdt:P18 ?_image. } } LIMIT 100
The code to fix is located in https://www.wikidata.org/wiki/MediaWiki:Gadget-EasyQuery.js
When you work on this task, you can test the code and your changes by copy-pasting the code into the console (in Inspect element) of your web browser's developer tools. Once your code works as expected, upload your new version as a file into the Phabricator task. @Ladsgroup will review your code there.