Skip to content

Compatibility with Handlebarsjs (and Handlerbars.CSharp)? #7

@oformaniuk

Description

@oformaniuk

The problem

According to Handlebars helper documentation:

A Handlebars helper call is a simple identifier, followed by zero or more parameters

and Identifier definition:

Identifiers may be any unicode character except for the following:
Whitespace ! " # % & ' ( ) * + , . / ; < = > @ [ \ ] ^ ` { | } ~

It looks like usage example is not valid:

{{String.Append "foobar" "bar"}}

In order to be rendered correctly it should be:

{{[String.Append] "foobar" "bar"}}

Simple example of Handlebarsjs behavior using suggested syntax: https://jsfiddle.net/bc89sjmg/1/

  • Expected:
    • AAA - printed twice
    • BBB - printed once
  • Actual:
    • AAA - printed once
    • BBB - printed once

In Handlerbars.CSharp I've followed the same approach to be as close to Handlebarsjs as possible. Changes related to the topic were made in oformaniuk/Handlebars.Net/pull/20 and oformaniuk/Handlebars.Net/pull/21

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions