add global html sanitizer

This commit is contained in:
Raymond 2014-10-15 20:55:29 +08:00
parent c2331988db
commit f483b61cfb
2 changed files with 11 additions and 2 deletions

View File

@ -75,4 +75,13 @@ angular.module('redash.filters', []).
}
return $sce.trustAsHtml(marked(text));
}
}]);
}])
.filter('trustAsHtml', ['$sce', function ($sce) {
return function (text) {
if (!text) {
return "";
}
return $sce.trustAsHtml(text);
}
}]);

View File

@ -28,7 +28,7 @@
<ui-select-choices repeat="q in queries"
refresh="searchQueries($select.search)"
refresh-delay="0">
<div ng-bind-html="q.name | highlight: $select.search | markdown"></div>
<div ng-bind-html="q.name | highlight: $select.search | trustAsHtml"></div>
</ui-select-choices>
</ui-select>
</div>