parse
Checks whether a Liquid template is valid. It returns an empty list when the template is valid, or one or more descriptions when the template contains errors.
Use parse to validate a template before storing, enabling, or rendering it.
Signature
filtrera
import 'liquid'
text |> parse => [text]Returns
[text] — an empty list for a valid template; otherwise one or more descriptions of the template errors.
Examples
A valid template parses to an empty list
filtrera
import 'liquid'
from 'Hello {{ name }}' parse
// Returns:
// []A malformed template returns its errors
filtrera
import 'liquid'
from 'Hello {% if %}' parse
// Returns:
// ['…'] — one description per parse errorNotes
parsetakes no arguments: the template source is the input, to the left- Pair it with render: validate templates before use, then render them with data