## Scenario ### Handlebars.js #### Template ```handlebars {{^test input}}empty{{else}}not empty{{/test}} ``` #### Helper ```js Handlebars.registerHelper("test", function(conditional, options) { if (conditional) { return options.fn(conditional); } else { return options.inverse(conditional); } }); ``` #### Input & result ```js { "input": 1 } // Result: not empty ``` ```js { "input": 0 } // Result: empty ``` ### Handlebars.Net ```csharp [Fact] public void BlockHelperWithInversion() { string source = @"{{^test input}}empty{{else}}not empty{{/test}}"; var handlebars = Handlebars.Create(); handlebars.RegisterHelper("test", (output, options, context, arguments) => { if (HandlebarsUtils.IsTruthy(arguments[0])) { options.Template(output, context); } else { options.Inverse(output, context); } }); var template = handlebars.Compile(source); Assert.Equal("empty", template(null)); Assert.Equal("empty", template(new { otherInput = 1 })); Assert.Equal("not empty", template(new { input = 1 })); } ``` #### Actual result - :x: `^test` detected as `HandlebarsHelper` instead of `HandlebarsBlockHelper` - :x: `^test` tried to be late-bounded - :x: `Template references a helper that is not registered. Could not find helper '^test'` exception thrown #### Expected result - matches to Handlebars.js behaviour.
Activity
Implement `BlockHelperMissing`
Implement `BlockHelperMissing`