common.js: add stripHTML filter
This commit is contained in:
parent
c8cbbcb84d
commit
5b53fbda0b
@ -96,7 +96,7 @@
|
|||||||
<div class="card-body text-light">
|
<div class="card-body text-light">
|
||||||
<p class="lead">
|
<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>
|
<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>
|
||||||
<p ng-bind-html="my.exercices[s.params.exercice].statement"></p>
|
<p ng-bind-html="my.exercices[s.params.exercice].statement"></p>
|
||||||
<ul class="list-inline text-secondary">
|
<ul class="list-inline text-secondary">
|
||||||
|
@ -36,6 +36,16 @@ angular.module("FICApp")
|
|||||||
}]);
|
}]);
|
||||||
|
|
||||||
angular.module("FICApp")
|
angular.module("FICApp")
|
||||||
|
.filter("stripHTML", function() {
|
||||||
|
return function(input) {
|
||||||
|
if (!input)
|
||||||
|
return input;
|
||||||
|
return input.replace(
|
||||||
|
/(<([^>]+)>)/ig,
|
||||||
|
""
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})
|
||||||
.filter("capitalize", function() {
|
.filter("capitalize", function() {
|
||||||
return function(input) {
|
return function(input) {
|
||||||
return input.capitalize();
|
return input.capitalize();
|
||||||
|
Loading…
Reference in New Issue
Block a user