|
@@ -14,7 +14,8 @@ define([
|
|
|
'angular',
|
|
'angular',
|
|
|
'app',
|
|
'app',
|
|
|
'underscore',
|
|
'underscore',
|
|
|
- 'require'
|
|
|
|
|
|
|
+ 'require',
|
|
|
|
|
+ 'services/filterSrv'
|
|
|
],
|
|
],
|
|
|
function (angular, app, _, require) {
|
|
function (angular, app, _, require) {
|
|
|
'use strict';
|
|
'use strict';
|
|
@@ -98,4 +99,25 @@ function (angular, app, _, require) {
|
|
|
.replace(/</g, '<');
|
|
.replace(/</g, '<');
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
-});
|
|
|
|
|
|
|
+
|
|
|
|
|
+ module.filter('applytemplate', function(filterSrv) {
|
|
|
|
|
+ return function (input) {
|
|
|
|
|
+ return filterSrv.applyTemplateToTarget(input);
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ module.filter('applymarkdown', function() {
|
|
|
|
|
+ return function (input) {
|
|
|
|
|
+ if(require.defined('./lib/showdown')) {
|
|
|
|
|
+ var Showdown = require('./lib/showdown');
|
|
|
|
|
+ var converter = new Showdown.converter();
|
|
|
|
|
+ var text = input.replace(/&/g, '&')
|
|
|
|
|
+ .replace(/>/g, '>')
|
|
|
|
|
+ .replace(/</g, '<');
|
|
|
|
|
+ return converter.makeHtml(text);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return input;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+});
|