Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Sublime's EJS highlighting going crazy over my simple loop?

I have a very simple EJS page with a loop in. Here is the code:

<!DOCTYPE html>
<html>

<head>
    <title>
        <%= title %>
    </title>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    <link rel='stylesheet' href='/stylesheets/style.css' />
</head>

<body>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <h1><%= title %></h1>
                <p>Welcome to
                    <%= title %>
                </p>
                <table>
                    <tbody>
                        <% for(var i=0; i<jobs.length; i++) { %>
                            <li>
                                <%= jobs[i].client.name %>
                            </li>
                            <% } %>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
</body>

</html>

However this is how Sublime's EJS highlighting is rendering it:

enter image description here

I can't see what's wrong with my code, and why the <%= title %> tags are highlighted correctly but the loop isn't.

UPDATE I want to add that the page is actually rendering exactly as it should in a browser, so I don't know why Sublime is throwing a hissy fit.

like image 686
Aron Avatar asked Nov 29 '25 14:11

Aron


1 Answers

This is a known issue in the Sublime extension.

I removed the extension and installed EJS 2.

like image 159
Aron Avatar answered Dec 01 '25 13:12

Aron