Content interpolated with bracket syntax will be evaluated for code, the output of which is included in your HTML output.
title follows the basic pattern for evaluating a template local, but the code in between
#{
and}
is evaluated, escaped, and the result buffered into the output of the template being rendered. [Source]
If you need to include raw HTML syntax, use an exclamation point instead of a pound symbol (!{}
instead of #{}
).
1 2 3 4 |
let tag = "<div>You can't escape me!</div>"; res.render("index", { myTag: tag }); |
1 2 3 4 5 |
doctype html html head body !{myTag} |
1 2 3 4 5 |
doctype html html head body !{myTag} |