Skip to content

Can't format files with EJS inside opening HTML tags#11

Description

@manuhabitela

Hi 馃憢

Thanks for the plugin :)

It seems I have an issue very similar to this closed one: #8

For example, prettier can't format this piece of code:

<button class="fr-btn" type="submit" <% if (locals.ariaLabel) { %>aria-label="<%= locals.ariaLabel %>"<% } %>>
    <%= label %>
</button>

Because of the test inside the button opening tag:

[error] src/[...].ejs: SyntaxError: Opening tag "button" not terminated. (14:5)
[error]   12 |         <% } %>
[error]   13 |     </span>
[error] > 14 |     <button class="fr-btn" type="submit" <% if (locals.ariaLabel) { %>aria-label="<%= locals.ariaLabel %>"<% } %>>
[error]      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]   15 |         <%= label %>
[error]   16 |     </button>
[error]   17 | </div>

I'm using the latest plugin version and latest prettier version. I also tried the nested EJS example in the readme and it crashes too.

Is there something I missed? Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions