Skip to content

Commit e854c53

Browse files
committed
Merge branch '23-feature-component-like-partial-templa'
2 parents f9ff4b6 + a548e0a commit e854c53

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

libs/FuManchu/Parser/HandlebarsParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ public void AtTag()
770770
}
771771
PutBack(current!);
772772
NextToken();
773-
if (Context!.CurrentBlock.IsPartialBlock)
773+
if (Context!.CurrentBlock.IsPartialBlock && !Context.CurrentBlock.IsPartialBlockContent)
774774
{
775775
// This is a zone content element, which is actually a block, not a span
776776
AtPartialBlockContentTag();

tests/FuManchu.Tests/Renderer/PartialBlockRendererFacts.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,16 @@ public void CanRenderPartialBlock_WithManyZones()
116116

117117
RenderTest(template, expected);
118118
}
119+
120+
[Fact]
121+
public void CanRenderPartialBlock_WithNestedPartial()
122+
{
123+
HandlebarsService.RegisterPartial("paragraph", "<p>{{text}}</p>");
124+
HandlebarsService.RegisterPartial("layout", "{{<content}}");
125+
126+
string template = "{{#>layout}}{{>content}}{{>paragraph text=\"Hello World\"}}{{/content}}{{/layout}}";
127+
string expected = "<p>Hello World</p>";
128+
129+
RenderTest(template, expected);
130+
}
119131
}

0 commit comments

Comments
 (0)