Exercise 3: Confirming Escaped vs. Raw Output — Possible Solution ==================================================================== SETUP ------------------------------ A page row stored with: body: "

Regular text with bold emphasis.

" TEST A — <%= %> ------------------------------
<%= page.body %>
Renders as literal visible text on the page:

Regular text with bold emphasis.

with the angle brackets shown as plain characters - nothing renders bold, and no real

/ elements exist in the DOM. TEST B — <%- %> ------------------------------

<%- page.body %>
Renders as real, parsed HTML - "Regular text with bold emphasis." appears on the page with "bold emphasis" genuinely bold, and inspecting the page's own HTML source shows real

and elements in the DOM. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly demonstrates that <%= %> HTML-escapes its output by default, printing tags as literal text, while <%- %> outputs the identical string as real, unescaped HTML - concrete proof of EJS's own two-tier output model, and of why <%- %> is the deliberate, necessary choice for rendering page.body.