Use liquid filter in JavaScript
maxfrigge opened this issue · comments
Max Frigge commented
Is there a way to apply a filter outside of a template?
There are certain occasions where this could be useful.
var result = Liquid.applyFilter(myVar, "capitalize");
Matt McCray commented
Haven't tested this, but in theory you should be able to do this:
Liquid.Strainer.filters.capitalize( myVar )
A more official API for accessing those might be nice.
Max Frigge commented
It works... thanks!