Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SyntaxExplanation
<%- variable %>

Insert the variable contents with escaping.

This escapes any HTML code using the Underline.js escape function.

<%- = variable %>

Insert the variable contents in raw form.

Any HTML code is passed through verbatim.

Note

Only use this for data that's from safe locations. Your default method should be to use <%- variable %> for best security.


<% JavaScript Code %>Execute JavaScript code in the current template context. The most common use case for this is a loop as shown in the example above.

...