Describe the bug
I'm trying to register a partial that can either be used as a block, with block content, or inline without content. However, both methods I tried using to accomplish this aren't working because @partial-block doesn't seem to be properly recognized. The only way I can get @partial-block to render is by using {{> @partial-block}} on it's own. Both of the following cases don't render anything:
Block:
{{#> @partial-block }}
{{/@partial-block}}
Conditional:
{{#if @partial-block}}
{{> @partial-block}}
{{/if}}
Expected behavior:
@partial-block should be recognized in both the above scenarios and render the block content if it is provided.
Test to reproduce
[Fact]publicvoidDescriptive_Test_Name_Here(){vartemplate=@"{{#> myPartial}}Block content{{/myPartial}}";varpartial=@" Conditional: {{#if @partial-block}} {{> @partial-block}} {{/if}}Plain: {{> @partial-block}}Block:{{#> @partial-block }}{{/@partial-block}}";varhandlebars=Handlebars.Create();handlebars.RegisterTemplate("myPartial",partial);varrender=handlebars.Compile(template);objectdata=new{};varactual=render(data);Assert.Equal("Conditional: Block content Plain: Block content Block: Block content",actual);}
Describe the bug
I'm trying to register a partial that can either be used as a block, with block content, or inline without content. However, both methods I tried using to accomplish this aren't working because
@partial-blockdoesn't seem to be properly recognized. The only way I can get@partial-blockto render is by using{{> @partial-block}}on it's own. Both of the following cases don't render anything:Block:
Conditional:
Expected behavior:
@partial-blockshould be recognized in both the above scenarios and render the block content if it is provided.Test to reproduce