Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Feature Idea - Embedded JavaScript Mode #520

kruncher opened this Issue · 4 comments

4 participants


Hello guys,

I have created a new mode for my project called "HTML + EJS" which I believe could be of benefit to others. It is literally an altered version of the HTML mode that utilises the existing JavaScript mode.

Is it possible to add configuration options to a mode? For example, EJS supports custom open and close tags. Is it possible to add a custom open / close tag option for this mode?

If there is interest for this mode I will create a pull request.



I'm trying to understand what you did. Looking at the HTML highlight rules ( it appears to embed the JavaScript mode already. How is what you are doing different?


The additional rules allow for the following EJS:

<h1><%= document.title %></h1>
<% if (something === true) { %>
   <div>Something is true!</div>
<% } %>

I am using the EJS feature of custom open / close tags which allows me to use the following instead:

<h1><?= document.title ?></h1>
<? if (something === true) { ?>
   <div>Something is true!</div>
<? } ?>

So there would need to be a way to specify custom open / close tags within a mode instance. What would be the best way to add custom options to a specific mode?

EJS offers a similar type of syntax to that of PHP, I am not referring to the usual <script></script> elements:


Ah sorry, I read EJS, simply as embedded JavaScript (like with script tags), but you meant the specific "templating" language, if you will.


ejs mode was added in #1445

@nightwing nightwing closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.