I have been trying to save some part of my page as html in my mongodb database using mongoose, here's what my Schema looks like
var projectSchema = new mongoose.Schema({
title: String,
subtitle: String,
description: [],
thumbnail: String,
images: [String],
keywords: [String],
hours: Number,
tools: [String],
views: Number,
created: {
type: Date,
default: Date.now
}
});
it's the one called "description", and in my HTML I loop over the array and extract the string, then try to view it as HTML but it always shows up as text, here's my EJS file
<% var description = project.description %>
<% description.forEach(function(description){ %>
<%= description %>
<% }); %>
now after that it just prints the string to my page and doesn't render it as HTML
Edit: Now it works by using <%- %> instead of <%= %>

<%- description %>