Share markdown angular filter via client.js

This commit is contained in:
Johannes Zellner
2020-07-10 15:20:53 +02:00
parent 48983879ab
commit 8b160cbbfd
8 changed files with 42 additions and 18 deletions

View File

@@ -386,24 +386,6 @@ app.filter('prettyEmailAddresses', function () {
};
});
app.filter('markdown2html', function () {
var converter = new showdown.Converter({
extensions: [ 'targetblank' ],
simplifiedAutoLink: true,
strikethrough: true,
tables: true
});
// without this cache, the code runs into some infinite loop (https://github.com/angular/angular.js/issues/3980)
var cache = {};
return function (text) {
if (cache[text]) return cache[text];
cache[text] = converter.makeHtml(text);
return cache[text];
};
});
app.filter('postInstallMessage', function () {
var SSO_MARKER = '=== sso ===';