mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
fix: parser throws on non-string input, #726
This commit is contained in:
@@ -26,6 +26,7 @@ export class Parser {
|
||||
this.parseLimit = new Limiter('parse length', liquid.options.parseLimit)
|
||||
}
|
||||
public parse (html: string, filepath?: string): Template[] {
|
||||
html = String(html)
|
||||
this.parseLimit.use(html.length)
|
||||
const tokenizer = new Tokenizer(html, this.liquid.options.operators, filepath)
|
||||
const tokens = tokenizer.readTopLevelTokens(this.liquid.options)
|
||||
|
||||
Reference in New Issue
Block a user