core: contest(OI): 订正模式

This commit is contained in:
undefined committed 2021-05-19 13:26:37 +08:00
1 parent e70beab967
commit 15827eeabb
7 files changed
+65 -31

No files matched your search

@@ -66,6 +66,7 @@ class Nunjucks extends nunjucks.Environment {
this.addFilter('base64_encode', (s) => Buffer.from(s).toString('base64'));
this.addFilter('base64_decode', (s) => Buffer.from(s, 'base64').toString());
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 = '';