mde / ejs

Embedded JavaScript templates -- http://ejs.co
Apache License 2.0
7.79k stars 843 forks source link

<%-%> auto converting \n in <br> #747

Closed agrobens closed 1 year ago

agrobens commented 1 year ago

In my code:

<script type="text/html" id="templatePreviewWhastapp">
<p>Hello</p>
<p><%-message%></p>
</script>
var templatePreviewWhastapp = $('#templatePreviewWhastapp').html();
ejs.render(templatePreviewWhastapp, {message: "Wellcome\nJustin"});

The result is:

<p>Hello</p>
<p>Wellcome<br/>Justin</p>

Why EJS compile text auto converting \n in
?

How to I disable?

agrobens commented 1 year ago

Ignore, erro is caused from other script