Skip to content
Sahab Yazdani edited this page Nov 14, 2011 · 2 revisions

Mustache Syntax: Comments

Description

Comments in Mustache are started with the {{! token and ended with the !}} token. Comments can be started anywhere in code and can finish anywhere in code (that is, comments can be multilined and can traverse across other Mustache tags). Comments obey the Change Delimiter command.

Examples

{{!Single-line comment !}}

{{!
This is a multi-line comment
!}}

{{!
Comments can comment out {{mustache}} {{#code}}{{/code}}
!}}

{{=~~ ~~=}}
    ~~! Comments obey the delimiter change token !~~
~~={{ }}=~~

Spec Conformity

Note that although these comments are Mustache Spec-conformant, the reverse is not true since the end token of !}} is required. That means that comments written for other flavours of Mustache will not be parsed correctly by this implementation.

Clone this wiki locally