Tests
Test: array
Template
{{ [1, 2, 3, 4]|first }}
Output Django (error) v1.10.1
Could not parse some characters: |[1, 2, 3, 4]||first
Output Jinja2 v2.8.0
1
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks v2.5.0
1
Output Swig v1.4.2
1
Output Twig v1.24.2
1
Output Twigjs v0.9.5
1
Test: number
Template
{{ 1234|first }}
Output Django (error) v1.10.1
'int' object has no attribute '__getitem__'
Output Jinja2 (error) v2.8.0
'int' object is not iterable
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks (error) v2.5.0
(no output)
Output Swig v1.4.2
undefined
Output Twig v1.24.2
1
Output Twigjs (error) v0.9.5
(no output)
Test: object
Template
{{ { a: 1, b: 2, c: 3, d: 4 }|first }}
Output Django (error) v1.10.1
Could not parse some characters: |{ a: 1, b: 2, c: 3, d: 4 }||first
Output Jinja2 v2.8.0
Output Liquid (error) v3.0.6
Liquid syntax error: Variable '{{ { a: 1, b: 2, c: 3, d: 4 }' was not properly terminated with regexp: /\}\}/
Output Nunjucks (error) v2.5.0
(no output)
Output Swig v1.4.2
1
Output Twig v1.24.2
1
Output Twigjs v0.9.5
1
Test: string
Template
{{ '1234'|first }}
Output Django v1.10.1
1
Output Jinja2 v2.8.0
1
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks v2.5.0
1
Output Swig v1.4.2
1
Output Twig v1.24.2
1
Output Twigjs v0.9.5
1