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

Fix edge case around nested empty partials #658

Merged
merged 3 commits into from
Jul 14, 2024

Conversation

cmrschwarz
Copy link
Contributor

@cmrschwarz cmrschwarz commented Jul 13, 2024

This solves an edge case regarding nested, empty partials.
We currently don't restore our trailing newline flag when exiting a partial / helper.
This assumption fails if the partial doesn't produce any content at all.
This PR solves this.

Example testcase:

{{~#*inline "empty_partial"}}{{/inline}}
{{~#*inline "indented_partial"}}
{{>empty_partial}}foo
{{/inline}}
    {{>indented_partial}}

Output Before

foo

Output After

    foo

@coveralls
Copy link

coveralls commented Jul 13, 2024

Coverage Status

coverage: 81.472% (+0.08%) from 81.389%
when pulling c60ef28 on cmrschwarz:recursive_empty_partials_fix
into 913784b on sunng87:master.

@cmrschwarz cmrschwarz changed the title Fix edge case around recursive empty partials Fix edge case around nested empty partials Jul 13, 2024
@sunng87 sunng87 merged commit 98d51a1 into sunng87:master Jul 14, 2024
9 checks passed
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 this pull request may close these issues.

3 participants