-
Notifications
You must be signed in to change notification settings - Fork 235
Closed
Labels
Description
Tried using a layout inheritance and defining blocks inline.
Am i doing something wrong or is this currently not supported?
public void PartialLayoutAndInlineBlock()
{
string layout = "{{#>body}}{{fallback}}{{/body}}";
string page = @"{{#>layout}}{{#*inline ""body""}}{{truebody}}{{/inline}}{{/body}}{{/layout}}";
var template = Handlebars.Compile(page);
var data = new
{
fallback = "aaa",
truebody = "Hello world"
};
using (var reader = new StringReader(layout))
{
var partialTemplate = Handlebars.Compile(reader);
Handlebars.RegisterTemplate("layout", partialTemplate);
}
var result = template(data);
Assert.Equal("Hello world", result);
}