Showing posts with label ejs. Show all posts
Showing posts with label ejs. Show all posts

Thursday, January 20, 2011

EJS default escaping

In EJS (Embedded JavaScript) escaping is a default behaviour.

// escape by default
<%= VARIABLE_NAME %>

This can easily mess up a couple of things (including JSON, HTML rendering), luckily you can turn it off by using

// render out string
<%- VARIABLE_NAME %>