Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the ? suffix for empty attributes optional #238

Merged
merged 3 commits into from
Nov 11, 2020

Conversation

lambda-fairy
Copy link
Owner

@lambda-fairy lambda-fairy commented Nov 7, 2020

Summary

Maud no longer requires ? after an empty attribute. For example, this code

html! {
    input type="checkbox" checked? disabled?[is_disabled];
}

can now be written as

html! {
    input type="checkbox" checked disabled[is_disabled];
}

The old syntax is still allowed, but soft-deprecated. It will be removed in some future release (TBD).

Rationale

The ? was necessary back when braces were optional, such that a bare identifier (e.g. title) could mean either an attribute or an element.

But with #137 making braces mandatory, there's no need for the ? anymore – it is perfectly unambiguous without it.

@lambda-fairy
Copy link
Owner Author

lambda-fairy commented Nov 7, 2020

TODO:

  • Update changelog
  • Update docs

@lambda-fairy lambda-fairy marked this pull request as ready for review November 8, 2020 09:10
@lambda-fairy lambda-fairy merged commit d5dec51 into master Nov 11, 2020
@lambda-fairy lambda-fairy deleted the shorter-empty-attrs branch November 11, 2020 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant