tera
tera copied to clipboard
Extends does not work when template has BOM
This is the beginning of my file:
$ head -n2 home.html.tera
{% extends "template" }
{% block content %}
and in hex dump:
$ xxd home.html.tera | head -n2
00000000: efbb bf7b 2520 6578 7465 6e64 7320 2274 ...{% extends "t
00000010: 656d 706c 6174 6522 207d 0a7b 2520 626c emplate" }.{% bl
when trying to render the template Tera panics with:
Parsing error(s):
* Failed to parse "templates/home.html.tera"
--> 1:2
|
1 | {% extends "template" }␊
| ^---
|
= unexpected tag; expected end of input or some content
When running dos2unix home.html.tera, which removes the BOM it works.
This is the UTF-8 BOM but I assume it's the same for other encodings as well.
I'm using tera 1.5.0.
Ah damn, must be something in the grammar...