-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Partials do not respect the indentation from source content #482
Comments
I've worked around my use case for with a custom block helper that explicitly injects indentation into its rendered content. |
Thank you for reporting! I will look into my template parser to see if |
#486 does not appear to have actually solved this. If the text put into the partial spans multiple lines, the next line does not keep the same indentation as the first line. Also, it appears as though none of the tests for indentation in partials test what happens if the string that is going to be used for the render spans multiple lines. |
Can this please be reopened? Or should I file a new issue? |
@TheButlah could you please provide me a demo template for reproducing this? |
I've created #504 to track this. |
Sorry, I just saw this! It looks like you solved it though :) |
Partial calls only use indentation defined in the partial template itself.
Example
inner.hbs
outer.hbs
main.rs
Result:
Handlebars JS Handling
Handlebars js by default uses the indentation of the partial call itself, but has a compiler flag to disable this functionality, see
preventIndent
in the Handlebars.compile options.Use Case
I'm using recursively nested partials to render a tree view, so specifying indentation in the target template itself does not work.
--
Thanks for your hard work!
The text was updated successfully, but these errors were encountered: