Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Add EJS? #139

Closed
rodhash opened this issue Sep 25, 2022 · 5 comments
Closed

Add EJS? #139

rodhash opened this issue Sep 25, 2022 · 5 comments

Comments

@rodhash
Copy link

rodhash commented Sep 25, 2022

Hello,

Is it possible to add EJS chars for HTML lang? Like "<%" and "<%=" for opening and "%>" for closing. I tried myself but no luck there.

Thanks

@rodhash
Copy link
Author

rodhash commented Sep 25, 2022

One more thing that would be nice is to not match ">" in the middle of the line.

Currently my "=>" for the callback fn became half highlighted:

image

Or perhaps would be ok to apply the highlight when it's actually closing with %> as I have inside my <li> tag.

@p00f
Copy link
Owner

p00f commented Sep 26, 2022

Can you paste an example

@rodhash
Copy link
Author

rodhash commented Sep 29, 2022

Sorry delay..

Sure, in this example I'm updating the title:

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title><%= pageTitle %></title>
    <link rel="stylesheet" href="/css/main.css">
    <link rel="stylesheet" href="/css/forms.css">
    <link rel="stylesheet" href="/css/product.css">
</head>

Here, it's a full file (404.ejs) with 3 different includes:

<%- include('./includes/head.ejs') %>

</head>
<%- include('./includes/navigation.ejs') %>

<body>
    <h1>Page Not Found!</h1>

<%- include('./includes/end.ejs') %>

Here, we have two variables kindofday and el and a array method being used forEach:

<body>
    <h1><%= kindOfDay %> </h1>

    <ul>
        <% itemList.forEach( el => { %>
            <li><%= el %> </li>
        <% }) %>
    </ul>
</body>

@p00f
Copy link
Owner

p00f commented Sep 29, 2022

tree-sitter doesn't recognise them:
image

@p00f p00f closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2022
@p00f
Copy link
Owner

p00f commented Sep 29, 2022

nvim-treesitter needs to add the embedded_template language (no checkmark): https://github.com/nvim-treesitter/nvim-treesitter#supported-languages

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants