kainjow / Mustache

Mustache text templates for modern C++
Boost Software License 1.0
357 stars 49 forks source link

Newlines are not HTML escaped #18

Closed Snafuuz closed 6 years ago

Snafuuz commented 6 years ago

The mustache documentation says: "All variables are HTML escaped by default."

The documentation is not very explicit about newlines in this context, but I think they should be converted to
tags, so a value can also have multiple lines and still be rendered correctly, including line breaks.

The problem can of course be avoided by using a custom escaping function, but I assume the correct behaviour would be to translate newlines into
by default

Snafuuz commented 6 years ago

=> I filed a pull request with a change that adds newline conversion to the HTML escape function https://github.com/kainjow/Mustache/pull/19

kainjow commented 6 years ago

See my comments in the PR.