Skip to content

First Inline Block always contains garbage data #380

@olegolo

Description

@olegolo

Problem statement:
Having a layout
Handlebars.RegisterTemplate("layout", @"Hello {{>sec1}}" and {{>sec2}}");
and a template
{{#*inline 'sec1'}} Tom {{/inline}} {{#*inline 'sec2'}} Jerry {{/inline}}

Expected result: Hello Tom and Jerry
Actual result: Hello and Jerry

After some experiments, I found out that the first section is always used for the 'everything else' like the texts outside of sections.

Workaround#1 inverse dependencies and register template as partial

Workaround#2 having a layout with the first Default section
{{#*inline 'garbage'}} this is going to fall into hidden div for example {{/inline}} {{#*inline 'sec1'}} Tom {{/inline}} {{#*inline 'sec2'}} Jerry {{/inline}}

Suggestion
Add the ability to completely disable garbage content and omit the first (mandatory to make it work) section.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions