I am trying to create a node application and I am using the EJS template language on VS Code. However whenever I go to my store.ejs
and put in the <% %>
it doesn’t highlight at all and just shows up as plain text. I’ve downloaded the VS Code EJS support extension and have changed my user setting, but I still can’t get anything
Try this ejs language support extension.
https://marketplace.visualstudio.com/items?itemName=DigitalBrainstem.javascript-ejs-support
That was the extension I downloaded, but it still does’t work
A work-around exists to surround the code with commented script tags.
/*<script>*/
let people = ['geddy', 'neil', 'alex'],
html = ejs.render('<%= people.join(", "); %>', { people: people });
document.getElementById('output').innerHTML = html;
/*</script>*/