feat: passing liquid to FilterImpl, closes #277

This commit is contained in:
harttle
2020-12-08 00:17:27 +08:00
parent 2bbf50171b
commit f9f595f0f4
11 changed files with 52 additions and 25 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ export class Liquid {
this.parser = new Parser(this)
this.renderer = new Render()
this.fs = opts.fs || fs
this.filters = new FilterMap(this.options.strictFilters)
this.filters = new FilterMap(this.options.strictFilters, this)
this.tags = new TagMap()
forOwn(builtinTags, (conf: TagImplOptions, name: string) => this.registerTag(snakeCase(name), conf))
@@ -104,7 +104,7 @@ export class Liquid {
}
public _evalValue (str: string, ctx: Context): IterableIterator<any> {
const value = new Value(str, this.filters)
const value = new Value(str, this.filters, this)
return value.value(ctx)
}
public async evalValue (str: string, ctx: Context): Promise<any> {