ui: template: use builtin nl2br

This commit is contained in:
undefined committed 2022-05-30 16:11:22 +08:00
1 parent dc7d53b59c
commit ff096322fc
3 files changed
+9 -10

No files matched your search

@@ -77,7 +77,6 @@ class Nunjucks extends nunjucks.Environment {
this.addFilter('base64_decode', (s) => Buffer.from(s, 'base64').toString());
this.addFilter('jsesc', (self) => jsesc(self, { isScriptContext: true }));
this.addFilter('bitand', (self, val) => self & val);
this.addFilter('replaceBr', (self) => self.toString().replace(/\n/g, '<br>'));
this.addFilter('toString', (self) => (typeof self === 'string' ? self : JSON.stringify(self, replacer)));
this.addFilter('content', (content, language, html) => {
let s = '';