mde / ejs

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

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

Closed agrobens closed 9 months ago

agrobens commented 9 months 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 9 months ago

Ignore, erro is caused from other script