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

Whitespace trimming does not work on partial blocks #1071

Open
maxb opened this issue Jul 27, 2023 · 1 comment
Open

Whitespace trimming does not work on partial blocks #1071

maxb opened this issue Jul 27, 2023 · 1 comment

Comments

@maxb
Copy link

maxb commented Jul 27, 2023

Given this code (using 4.3.1):

        Handlebars handlebars = new Handlebars();
        Template template = handlebars.compile("root");
        System.out.println(template.apply(null));

and this root template:

BEGIN
{{~#>partial_test ~}}
MIDDLE
{{~/partial_test ~}}
END

and this partial_test template:

{{~> @partial-block ~}}

I expect no blank lines in the output, as whitespace is being stripped at every tag entry and exit.

However what I actually get is:

BEGIN

MIDDLE

END

It seems like the whitespace strip is not respected on any partial tags.

This is frustrating, as it means there is no way to write a filter-style partial block, which does not add extra whitespace, without starting the content immediately after the closing brace of the {{#> }} tag.

@maxb
Copy link
Author

maxb commented Jul 27, 2023

I've edited the originally submitted reproduction recipe, replacing with a simpler one, which also showcases an additional issue.

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

No branches or pull requests

1 participant