Closed sdedovic closed 10 months ago
I believe this is related to a few other issues but here is the behaviour I have noticed:
{% macro input(label, type="text") %} <label> {{ label }} <input type="{{type}}" /> </label> {% endmacro input %} <div> {{ self::input(label="Name", type="text") }} </div>
and try to render it, src/main.rs
src/main.rs
fn main() -> Result<()> { let tera = Tera::new("templates/**/*.html")?; println!("{:#?}", tera.render("test.html", &Context::default())?); }
it will successfully compile the template but error out when rendering it due to the macro definition console
$ cargo run Error: Failed to render 'test.html' Caused by: Invalid macro definition: `input`
I believe this is related to a few other issues but here is the behaviour I have noticed:
Issue 1 - Using a macro in the same template where it is defined
and try to render it,
src/main.rs
it will successfully compile the template but error out when rendering it due to the macro definition console