Does handlebars.js replace newline characters with
?

前端 未结 6 2123
星月不相逢
星月不相逢 2020-12-24 11:45

Trying to use handlebars.js for templating but the library seems to ignore newlines.

What is the correct way to deal with newlines? Should they be replaced manually

6条回答
  •  情深已故
    2020-12-24 11:47

    For others like me that were following the Getting start code and didn't know why there was no HTML showing up.

    in handlebars expressions documentation it states

    Handlebars HTML-escapes values returned by a {{expression}}. If you don't want Handlebars to escape a value, use the "triple-stash", {{{

提交回复
热议问题