Skip to content

Inline partial isolation issue #704

@YannikSc

Description

@YannikSc

Hey, I just noticed an issue with using partials and inline. The issue is, that as soon as an inner partial is overridden using inline, every call after the inline will use the overridden partial no matter which level it is on.

I boiled it down to a minimal example with this code in handlebars-rust

{{#*inline "test_partial"}}
    {{#>test_inner}}
        Inner Default
    {{/test_inner}}
{{/inline}}

{{>test_partial}}

{{#>test_partial}}
    {{#*inline "test_inner"}}
        Overridden
    {{/inline}}
{{/test_partial}}

{{>test_partial}}

I would expect the output to show

Inner Default

Overridden

Inner Default

But when rendered it outputs

Inner Default

Overridden

Overridden

I'm not sure how the intended behavior in handlebars-rust is, but I assume it should be fairly similar, I created a minimal example here to show the expected and present behavior of handlebars.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions