common.js: add stripHTML filter

This commit is contained in:
nemunaire 2018-12-05 04:09:59 +01:00
parent c8cbbcb84d
commit 5b53fbda0b
2 changed files with 11 additions and 1 deletions

View File

@ -96,7 +96,7 @@
<div class="card-body text-light">
<p class="lead">
<strong>Challenge <em>{{ themes[my.exercices[s.params.exercice].theme_id].exercices[s.params.exercice].title }}</em> du thème {{ themes[my.exercices[s.params.exercice].theme_id].name }}</strong>
<small class="authors" ng-if="themes[my.exercices[s.params.exercice].theme_id].authors">par {{ themes[my.exercices[s.params.exercice].theme_id].authors }}</small>
<small class="authors" ng-if="themes[my.exercices[s.params.exercice].theme_id].authors">par {{ themes[my.exercices[s.params.exercice].theme_id].authors | stripHTML }}</small>
</p>
<p ng-bind-html="my.exercices[s.params.exercice].statement"></p>
<ul class="list-inline text-secondary">

View File

@ -36,6 +36,16 @@ angular.module("FICApp")
}]);
angular.module("FICApp")
.filter("stripHTML", function() {
return function(input) {
if (!input)
return input;
return input.replace(
/(<([^>]+)>)/ig,
""
);
}
})
.filter("capitalize", function() {
return function(input) {
return input.capitalize();