ejs
ejs copied to clipboard
a filters mistake?
when i use the filters, i find something wrong。 in the line: https://github.com/tj/ejs/blob/master/lib/ejs.js#L57
function filtered(js) {
return js.substr(1).split('|').reduce(function(js, filter){
var parts = filter.split(':')
, name = parts.shift()
, args = parts.join(':') || ''; //this must be ',' , am i right ?
if (args) args = ', ' + args;
return 'filters.' + name + '(' + js + args + ')';
});
};
my code like this:
<%=: test | filter:'111':'222' %>
This version of EJS is no longer supported. The current version (installable with NPM) is here: https://github.com/mde/ejs
but v2 has remove the filters。 in my project i still use the filters, can you fix this bug in the old version。
The filters were removed because they're not core to what EJS does. Your best bet is to pre-process your data before handing it to your templates.