From 2cb6b054983758e86a22218764d45feb8babbac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sat, 23 Aug 2014 12:03:13 +0100 Subject: [PATCH] Wrap inlinecolour filter in $sce.trustAsHtml This is required because bo-html is unsafe whereas ng-bind-html requires "safe" HTML (ng-bind-html-unsafe is deprecated since 1.2) --- js/glowingbear.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index ac4cd1e..f88e85d 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -49,7 +49,7 @@ weechat.filter('irclinky', ['$filter', function($filter) { }; }]); -weechat.filter('inlinecolour', function() { +weechat.filter('inlinecolour', ['$sce', function($sce) { 'use strict'; return function(text) { @@ -61,9 +61,9 @@ weechat.filter('inlinecolour', function() { var hexColourRegex = /(^|[^&])\#([0-9a-f]{6})($|[^\w'"])/gmi; var substitute = '$1#$2
$3'; - return text.replace(hexColourRegex, substitute); + return $sce.trustAsHtml(text.replace(hexColourRegex, substitute)); }; -}); +}]); weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', function($rootScope, $log, models, plugins) {