Fix infinite loop when postinstall has <br/> in it

This commit is contained in:
Girish Ramakrishnan
2020-06-29 19:39:26 -07:00
parent 62e0e34e12
commit 9ba79cfb32

View File

@@ -394,8 +394,13 @@ app.filter('markdown2html', function () {
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) {
return converter.makeHtml(text);
if (cache[text]) return cache[text];
cache[text] = converter.makeHtml(text);
return cache[text];
};
});