Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack overflow when using inline partial #697

Open
JWo1F opened this issue Mar 9, 2025 · 1 comment · May be fixed by #700
Open

Stack overflow when using inline partial #697

JWo1F opened this issue Mar 9, 2025 · 1 comment · May be fixed by #700
Assignees

Comments

@JWo1F
Copy link

JWo1F commented Mar 9, 2025

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();
}
@sunng87
Copy link
Owner

sunng87 commented Mar 16, 2025

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

@sunng87 sunng87 self-assigned this Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants