Skip to content

Linter: Unexpected token with boolean attribute + erb #471

@darthdie

Description

@darthdie

Hi there!

I'm giving herb-lint a whirl, and I'm encountering the error:

[error] Unexpected token. Expected: TOKEN_ERB_START, TOKEN_HTML_DOCTYPE, TOKEN_HTML_COMMENT_START, TOKEN_IDENTIFIER, TOKEN_WHITESPACE, TOKEN_NBSP, TOKEN_AT, or TOKE, found: TOKEN_ERB_CONTENT. (UNEXPECTED_ERROR) (parser-no-errors)

When a boolean attribute is placed at the end of a tag containing ERB, e.g.

<div id="test" hidden>
  <%= "hi" %>
</div>

If I re-arrange it to the following it passes just fine:

<div hidden id="test">
  <%= "hi" %>
</div>

It seems to occur whether it's hidden, disabled, or checked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions