Skip to content

Fix edge case around nested empty partials#658

Merged
sunng87 merged 3 commits into
sunng87:masterfrom
cmrschwarz:recursive_empty_partials_fix
Jul 14, 2024
Merged

Fix edge case around nested empty partials#658
sunng87 merged 3 commits into
sunng87:masterfrom
cmrschwarz:recursive_empty_partials_fix

Conversation

@cmrschwarz

@cmrschwarz cmrschwarz commented Jul 13, 2024

Copy link
Copy Markdown
Contributor

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

coveralls commented Jul 13, 2024

Copy link
Copy Markdown

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
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