handlebars-rust icon indicating copy to clipboard operation
handlebars-rust copied to clipboard

Stack overflow when using inline partial

Open JWo1F opened this issue 9 months ago • 1 comments

Hey, everybody!

When using regular partials, as well as inline partials, I get a “stack overflow” error, although nesting is obviously limited. This is probably some internal bug.

fn test_hs() {
  let mut hs = Handlebars::new();
  hs.register_template_string("primary", "{{> @partial-block }}").unwrap();
  hs.register_template_string("secondary", "{{#*inline \"inl\"}}Bug{{/inline}}{{#>primary}}{{>inl}}{{> @partial-block }}{{/primary}}").unwrap();
  hs.register_template_string("current", "{{>secondary}}").unwrap();

  hs.render("current", &()).unwrap();
}

JWo1F avatar Mar 09 '25 15:03 JWo1F

Confirmed. The current stack based partial block implementation has some issues. I will need to revamp this part.

sunng87 avatar Mar 16 '25 00:03 sunng87