From b4b43a409488c1bd8f74ce95939739da0cb6b5bc Mon Sep 17 00:00:00 2001 From: Andre Malkine Date: Thu, 30 Jul 2015 18:10:32 -0400 Subject: [PATCH] applyFilters method inspects match for options The applyFilters method will now check the match for a json object and, if found, pass it as a secont paramenter in your filter hander. Useful for stating how you want your filter to address a given include in the context of the @@include statement itself. --- lib/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index fdb9da9..578a30d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -149,8 +149,12 @@ module.exports = function(opts) { // compose them together into one function var filter = filterlist.reduce(compose); + // check match for filter options object + var options = match.match('{([^}]*)}') || ["{}"]; + options = JSON.parse(options[0]); + // and apply the composed function to the stringified content - return filter(String(includeContent)); + return filter(String(includeContent), options); } };