Open kylecribbs opened 10 months ago
The problem very likely lies with the ejs tags you are using. This is actually one of the things mentioned in the documentation. The correct use of include requires the raw output tag <%-
, or else the HTML might double escape.
<%- include('./src/main/resources/ejs_templates/imports/imports.ejs');%>
EDIT: ok I also just saw that they have it in the docs like so
let str = "Hello <%= include('file', {person: 'John'}); %>",
fn = ejs.compile(str, {client: true});
fn(data, null, function(path, d){ // include callback
// path -> 'file'
// d -> {person: 'John'}
// Put your code here
// Return the contents of file as a string
}); // returns rendered string
but I guess it's dependent on what is inside the included file, <%-
for html and '<%=' for just ejs files? Absolutely not sure on this, needs some testing.
imports.ejs
output is: