From 9f39f84b9ca07d1276da5928495c6097a87e2b38 Mon Sep 17 00:00:00 2001 From: Hannah Bast Date: Mon, 23 Sep 2024 22:14:04 +0200 Subject: [PATCH] Fix links for `_sparql` and `_mapview` variable hack When a variable name ends with `_sparql` or `_mapview` and the value is a link, then a special link is shown which leads to an instance of the QLever UI with a SPARQL query or to an instance of Petrimaps, respectively. This was broken because the link was enclosed in quotes. These are now removed when they are there. In collaboration with @qup42 --- backend/static/js/helper.js | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/static/js/helper.js b/backend/static/js/helper.js index 5cbec05..6db5de9 100644 --- a/backend/static/js/helper.js +++ b/backend/static/js/helper.js @@ -846,6 +846,7 @@ function getFormattedResultEntry(str, maxLength, column = undefined) { // as a SPARQL query, and show it in the QLever UI or on a map, respectively. if (var_name.endsWith("_sparql") || var_name.endsWith("_mapview")) { isLink = true; + str = str.replace(/^"/, "").replace(/"$/, ""); if (var_name.endsWith("_sparql")) { mapview_url = `https://qlever.cs.uni-freiburg.de/${SLUG}/` + `?query=${encodeURIComponent(str)}`;