mattmccray / liquid.js

JavaScript port of Tobias Luetke's Liquid template engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use liquid filter in JavaScript

maxfrigge opened this issue · comments

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");

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.

It works... thanks!