mustache / mustache.github.com

The {{official}} website
http://mustache.github.io/
Other
2.32k stars 293 forks source link

How is multi-line content handled? #108

Closed Snafuuz closed 11 months ago

Snafuuz commented 6 years ago

What should I do if my content can contain line breaks? In general, content is HTML encoded while rendering, but that does not affect \n

What should I do if my content is a multi-line string?

Since content is HTML-encoded by default, wouldn't it make sense then, to also convert newlines in content to
tags?

jgonggrijp commented 11 months ago

Escaping of interpolation tags is the only situation where Mustache makes assumptions about the target language. Other than that, it's on you. If Mustache started inserting HTML tags, that would break the template language for many users.

Closing this, as this repository is only about the Mustache website, not about the template language.