1

i want to create small blog using express , ejs and markdown but when i tried to load markdown on page i saw this: enter image description here

my code:

<!DOCTYPE html>
<html lang="pl">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Blog</title>
    <link rel="stylesheet" href="/css/style.css" />
  </head>

  <body>
    <%=title%> <%=body%>
  </body>
</html>
Celso Wellington
  • 875
  • 8
  • 19
Nimplex
  • 23
  • 6
  • Does this answer your question? [How to escape HTML in node.js EJS view?](https://stackoverflow.com/questions/16183748/how-to-escape-html-in-node-js-ejs-view) – Wiktor Zychla Feb 15 '20 at 18:02

1 Answers1

0

It is simple you have to change your tags to <%- yourVar%>

<!DOCTYPE html>
<html lang="pl">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Blog</title>
    <link rel="stylesheet" href="/css/style.css" />
  </head>

  <body>
    <%-title%> <%-body%>
  </body>
</html>
pkoulianos
  • 177
  • 2
  • 5