Skip to content

end must be used where the docs say it should not be required (intro) #644

@nicosql

Description

@nicosql

codepen here: https://codepen.io/nicosql/pen/myEJmvB

Per the docs, https://hyperscript.org/docs/#introduction - the below should work without having to use end but instead it gives the below error.

Expected behavior: The below should work without having to use end

The end terminator can often be omitted for both features and statements if either of these conditions hold:

Another feature starts:
<button _="on click if true log 'Clicked!'
           on mouseenter log 'Mouse entered!'">
Click Me
</button>

error:

"hyperscript errors were found on the following element:" <button _="on click if true log 'Clicked!'
             on mouseenter log 'Mouse entered!' end">
Click Me
</button> "

" "Expected 'end' but found 'on'

             on mouseenter log 'Mouse entered!' end
              ^^

" "Error: Expected 'end' but found 'on'

solution:

<button _="on click if true log 'Clicked!' end
           on mouseenter log 'Mouse entered!'">
Click Me
</button>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions