Skip to content

Commit

Permalink
fix(item.details): add a filter to remove incorrect html tag / attribues
Browse files Browse the repository at this point in the history
  • Loading branch information
davinkevin committed Sep 13, 2015
1 parent d012eab commit 354843a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
angular.module('ps.common.filter.html2plainText', [])
.filter('htmlToPlaintext', function () {
return function(text) {
return String(text || "").replace(/<[^>]+>/gm, '');
};
}
);
.filter('htmlToPlaintext', () => (text) => String(text || "").replace(/<[^>]+>/gm, ''))
.filter('cleanHtml', () => (text) => String(text || "").replace(' =""', ''));
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<div class="panel-heading">
<h3 class="panel-title">{{ idc.item.title }}</h3>
</div>
<div class="panel-body" ng-bind-html="idc.item.description"></div>
<div class="panel-body" ng-bind-html="idc.item.description | cleanHtml"></div>
<div class="panel-footer">Date de publication : <strong>{{idc.item.pubdate | date : 'dd/MM/yyyy à HH:mm' }}</strong></div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class ItemDetailCtrl {

angular.module('ps.item.details', [
'ps.common.service.data.downloadManager',
'ps.common.service.playlist'
'ps.common.service.playlist',
'ps.common.filter.html2plainText'
]).config(function($routeProvider, commonKey) {
$routeProvider.
when('/podcasts/:podcastId/item/:itemId', {
Expand Down

0 comments on commit 354843a

Please sign in to comment.