How does one use a literal {{ in a Mustache template?

前端 未结 4 711
星月不相逢
星月不相逢 2020-12-07 00:16

How does one use a literal \"{{\" in a Mustache template?

On a side note, if I\'m using custom tags, like <% and %>, is there a way

4条回答
  •  -上瘾入骨i
    2020-12-07 01:06

    Assuming you are outputting HTML you could use an HTML entity to avoid it (mustache doesn't have any way to escape the opening tag built in).

    So to output {{ you would write {{.
    To output <% you would write <%.

提交回复
热议问题