Skip to content

Commit

Permalink
Merge pull request #190 from Ontotext-AD/GDB-4392-encode-triple-in-sp…
Browse files Browse the repository at this point in the history
…arql-link

GDB-4392 Encode triple in link to sparql view
  • Loading branch information
desislava-hristova-ontotext authored Mar 26, 2020
2 parents e80c5dd + 5dd97d6 commit eb3527d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/js/angular/explore/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ function ExploreCtrl($scope, $http, $location, toastr, $routeParams, $repositori
return !!$scope.tripleParam;
};

// TODO move this to core
$scope.encodeURIComponent = function (param) {
return encodeURIComponent(param);
};

$scope.getRdfStarLocalNames = function(triple) {
let localNames = triple.slice();
const trimmed = triple.replace(/[<>]+/g, '');
Expand Down
2 changes: 1 addition & 1 deletion src/pages/explore.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1>

<p ng-show="{{details.comment}}" data-escape="false">{{details.comment}}</p>
<p>
<span>Target:</span>&nbsp;<a href="sparql?query=describe{{tripleParam}}">{{tripleParam}}</a>
<span>Target:</span>&nbsp;<a href="sparql?query=describe%20{{encodeURIComponent(tripleParam)}}">{{tripleParam}}</a>
</p>
</div>

Expand Down

0 comments on commit eb3527d

Please sign in to comment.