Skip to content

Commit

Permalink
Merge branch '23-feature-component-like-partial-templa'
Browse files Browse the repository at this point in the history
  • Loading branch information
Antaris committed Nov 11, 2024
2 parents f9ff4b6 + a548e0a commit e854c53
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/FuManchu/Parser/HandlebarsParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ public void AtTag()
}
PutBack(current!);
NextToken();
if (Context!.CurrentBlock.IsPartialBlock)
if (Context!.CurrentBlock.IsPartialBlock && !Context.CurrentBlock.IsPartialBlockContent)
{
// This is a zone content element, which is actually a block, not a span
AtPartialBlockContentTag();
Expand Down
12 changes: 12 additions & 0 deletions tests/FuManchu.Tests/Renderer/PartialBlockRendererFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,16 @@ public void CanRenderPartialBlock_WithManyZones()

RenderTest(template, expected);
}

[Fact]
public void CanRenderPartialBlock_WithNestedPartial()
{
HandlebarsService.RegisterPartial("paragraph", "<p>{{text}}</p>");
HandlebarsService.RegisterPartial("layout", "{{<content}}");

string template = "{{#>layout}}{{>content}}{{>paragraph text=\"Hello World\"}}{{/content}}{{/layout}}";
string expected = "<p>Hello World</p>";

RenderTest(template, expected);
}
}

0 comments on commit e854c53

Please sign in to comment.