mde / ejs

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

You can render strings that use ejs tags #620

Closed jcubic closed 3 years ago

jcubic commented 3 years ago
<% "<% %>" %>

This should work. In comparison JavaScript template literals have no issue with object literals inside:

`say: ${{toString: () => "hello"}} world`

To fix this, you need a JavaScript parser.

RyanZim commented 3 years ago

This is what we have literal tags for: https://github.com/mde/ejs/blob/main/docs/syntax.md#literal-tags