mustache / mustache.github.com

The {{official}} website

Home Page:http://mustache.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What characters are allowed in a tag name/key?

davesmiths opened this issue · comments

Hi

What characters are allowed as a tag name/key?

I looked in the documentation but couldn't find anything. For example is {{first-name}} and {{firstName}} ok, or is it only lowercase a-z?

all the best
Dave

I believe the rules for tag name resolution are layout out in the spec at https://github.com/mustache/spec/blob/master/specs/sections.yml .
{{first-name}} should be fine, I think you run into trouble if your property name has a . in it.

Thanks locks, that was the doc I needed

Names can't start or end with whitespace or any of the tag sigils (e.g. # or ^). They can't contain a . or the current tag closing characters (by default that's }}). Other than that, the spec doesn't place any restrictions on tag names.

Not all implementations are that flexible, but I'd argue that's because they're not spec compliant ;)