If you extend a template that extends another, with blocks built on top of the previous one using {{ super() }}, askama emits warnings like this despite the behavior being "correct":
⚠️ templates/b.html:2:3: block `foo` was already called at `templates/c.html:3:3` so the previous one will be ignored
The following code:
templates/a.html
{% block foo %}{% endblock %}
templates/b.html
{% extends "a.html" %}
{% block foo %}
b
{{- super() -}}
{% endblock %}
templates/c.html
{% extends "b.html" %}
{% block foo -%}
c
{{- super() -}}
{% endblock %}
src/main.rs
use askama::Template;
#[derive(Template)]
#[template(path="c.html")]
struct X;
fn main() {
println!("{}", X.render().unwrap());
}
Renders as:
[eijebong@plutonium] ~/code/askama_repro (main) >>> cargo run
⚠️ templates/b.html:2:3: block `foo` was already called at `templates/c.html:3:3` so the previous one will be ignored
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/askama_repro`
c
b
askama: 0.15.1
rustc: rustc 1.94.0-nightly (1107bbac4 2025-12-26)
If you extend a template that extends another, with blocks built on top of the previous one using
{{ super() }}, askama emits warnings like this despite the behavior being "correct":The following code:
templates/a.html
templates/b.html
templates/c.html
src/main.rs
Renders as:
askama: 0.15.1
rustc:
rustc 1.94.0-nightly (1107bbac4 2025-12-26)