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

Error when using same partial twice in a row #143

Closed
hobofan opened this issue Mar 21, 2017 · 3 comments
Closed

Error when using same partial twice in a row #143

hobofan opened this issue Mar 21, 2017 · 3 comments
Assignees
Labels

Comments

@hobofan
Copy link

hobofan commented Mar 21, 2017

I get the following erro when using the same partial two times in a row:

Error rendering "template" line 3, col 1: Cannot include self in >

reduced code:

let main_template = "/home/hobofan/tmp/testcase/main.hbs";
let two_partial = "/home/hobofan/tmp/testcase/two.partial.hbs";

handlebars.register_template_file("template", &Path::new(main_template)).ok().unwrap();
handlebars.register_template_file("two", &Path::new(two_partial)).ok().unwrap();

let data = BTreeMap::<String, String>::new();

handlebars.render("template", &data).unwrap_or_else(|e| format!("{}", e))

main.hbs:

one
{{> two }}
three
{{> two }}

two.partial.hbs:

----- TWO ----

I am not 100% sure, but I think that should be valid Handlebars. When I use another partial between the two uses of {{> two }}, everything works fine.

I'm happy to provide any further information if that helps.

@sunng87
Copy link
Owner

sunng87 commented Mar 22, 2017

Thank you for reporting. It seems to be a bug for checking template name. I will look into it soon.

@sunng87 sunng87 self-assigned this Mar 22, 2017
@sunng87 sunng87 added the bug label Mar 22, 2017
sunng87 added a commit that referenced this issue Mar 22, 2017
Signed-off-by: Ning Sun <sunng@about.me>
@sunng87
Copy link
Owner

sunng87 commented Mar 22, 2017

Released in 0.25.2

@hobofan
Copy link
Author

hobofan commented Mar 22, 2017

Thanks for the quick fix! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants