From 47e6dda82ccb83b9df94f4dc450c528ed7663b7a Mon Sep 17 00:00:00 2001 From: Negue Date: Sat, 20 Sep 2014 12:05:26 +0200 Subject: [PATCH] add markdown as angular filter --- script/directives.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/script/directives.js b/script/directives.js index 07fd3596cc..2b5f86d61d 100644 --- a/script/directives.js +++ b/script/directives.js @@ -99,6 +99,16 @@ } }; }); + + habitrpg.filter('markdown', function() { + return function(input){ + var html = md.toHtml(input); + + html = html.replace(' href','target="_self" href'); + + return html; + }; + }); })() habitrpg.directive('questRewards', ['$rootScope', function($rootScope){