diff --git a/src/js/client.js b/src/js/client.js index b002bd18c..bdac265b9 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -87,6 +87,24 @@ angular.module('Application').filter('prettyDiskSize', function () { return function (size, fallback) { return prettyByteSize(size, fallback) || 'Not available yet'; } }); +angular.module('Application').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]; + }; +}); + // ---------------------------------------------- // Cloudron REST API wrapper diff --git a/src/js/index.js b/src/js/index.js index 202c78e1d..6ab254f29 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -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 ==='; diff --git a/src/logs.html b/src/logs.html index 3b241fb39..51af3fe5c 100644 --- a/src/logs.html +++ b/src/logs.html @@ -38,6 +38,10 @@ + + + + diff --git a/src/restore.html b/src/restore.html index 9bcabd172..724d806da 100644 --- a/src/restore.html +++ b/src/restore.html @@ -36,6 +36,10 @@ + + + + diff --git a/src/setup.html b/src/setup.html index e061aa98d..4cb1464bb 100644 --- a/src/setup.html +++ b/src/setup.html @@ -33,6 +33,10 @@ + + + + diff --git a/src/setupaccount.html b/src/setupaccount.html index 4699cf95f..8711a558d 100644 --- a/src/setupaccount.html +++ b/src/setupaccount.html @@ -38,6 +38,10 @@ + + + + diff --git a/src/setupdns.html b/src/setupdns.html index 46ac6a268..fc447f472 100644 --- a/src/setupdns.html +++ b/src/setupdns.html @@ -37,6 +37,10 @@ + + + + diff --git a/src/terminal.html b/src/terminal.html index c92b4d46c..596f55ed5 100644 --- a/src/terminal.html +++ b/src/terminal.html @@ -48,6 +48,10 @@ + + + +