Hong Nhung Tran
Hong Nhung Tran

Reputation: 1

Can not use the open and close tag with EJS

I have installed the EJS package in my nodejs project by doing npm install --save ejs, however when I type the tag <% %>, my IDE does not highlight the syntax.

A screenshot from my text editor

I expect the tag's color to change from white to blue.

Instead, the < is red and the % is white. How can I fix this?

Upvotes: 0

Views: 934

Answers (1)

karthikdivi
karthikdivi

Reputation: 3633

If you are using Visual Studio Code, by default it doesn't understand EJS, you need to install a plugin for that. Following should do

https://marketplace.visualstudio.com/items?itemName=DigitalBrainstem.javascript-ejs-support

Upvotes: 1

Related Questions