EJS rendering HTML

0
140

he problem I have is I want this to be styled like a paragraph:

<div class="show-post__content">

   <%= post.body %>

 </div>

The content of the post.body is: '<p>Hello there, this is a new post.</p>'

but it’s rendering like this:

Solution :-

I’ve got it:

<div class="show-post__content">

   <%- post.body %>

 </div>

Is the answer.

Thanks if you had a look!

LEAVE A REPLY

Please enter your comment!
Please enter your name here