2 * angular-markdown-directive v0.3.1
3 * (c) 2013-2014 Brian Ford http://briantford.com
9 angular.module('btford.markdown', ['ngSanitize']).
10 provider('markdownConverter', function () {
13 config: function (newOpts) {
17 return new Showdown.converter(opts);
21 directive('btfMarkdown', ['$sanitize', 'markdownConverter', function ($sanitize, markdownConverter) {
24 link: function (scope, element, attrs) {
25 if (attrs.btfMarkdown) {
26 scope.$watch(attrs.btfMarkdown, function (newVal) {
27 var html = newVal ? $sanitize(markdownConverter.makeHtml(newVal)) : '';
31 var html = $sanitize(markdownConverter.makeHtml(element.text()));