Share markdown angular filter via client.js
This commit is contained in:
@@ -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 ===';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user