k0kubun / hamlit

High Performance Haml Implementation
https://rubygems.org/gems/hamlit
Other
981 stars 59 forks source link

True boolean attributes like `<html amp>` #141

Closed just3ws closed 5 years ago

just3ws commented 5 years ago

https://github.com/k0kubun/hamlit/blob/1c658a990a6bf2da2280817794cf3aaf1cbebdb9/REFERENCE.md#limited-boolean-attributes

Seems like there's no way to define a true boolean attribute in Hamlit or am I missing something? This doesn't seem to be possible with the current version.

We need to generate <html amp> but using Hash syntax or the HTML-like syntax don't seem to do the trick.

There is the list Hamlit::AttributeBuilder::BOOLEAN_ATTRIBUTES but unfortunately it's frozen so can't add an item to the list there either.

k0kubun commented 5 years ago

This is by design. Please use https://github.com/hamlit/hamlit-boolean_attributes instead. Probably I should have written it there, but I'm in a vacation right now.