I have a Node JS server querying MongoDB, and then render the returns to an EJS template:
res.render('graphFabric.ejs', {'iBeacons':[(beacon)]});
.
When I try to recover the JSON from my template using
<%=iBeacons%>
, '
(single quotes) appear as '
;
For example: udid: 'b9407f30f5f8466eaff925556b57fe6d',
How is it possible to fix this issue since it breaks my JSON structure?
I have a Node JS server querying MongoDB, and then render the returns to an EJS template:
res.render('graphFabric.ejs', {'iBeacons':[(beacon)]});
.
When I try to recover the JSON from my template using
<%=iBeacons%>
, '
(single quotes) appear as '
;
For example: udid: 'b9407f30f5f8466eaff925556b57fe6d',
How is it possible to fix this issue since it breaks my JSON structure?
1 Answer
Reset to default 10Figured from https://github./tj/ejs/tree/0.8.3#features that I was using:
Escapes html by default with <%= code %>
when I should have used Unescaped buffering with <%- code %>
**Replacing =
with -
fixed the problem