Add data and aria attribute expansion helpers#32
Conversation
201bb6f to
1f08422
Compare
sbsoftware
left a comment
There was a problem hiding this comment.
I think the whole "precedence of explicit attributes" feature bloats the code while bringing little value. Let's just implement it the least surprising way - who comes last, wins.
|
Implemented as requested: precedence tracking was removed and merge behavior is now simple last-write-wins based on encounter order. What changed:
|
sbsoftware
left a comment
There was a problem hiding this comment.
Please audit the code for possible simplifications and redundancies to remove I've given one hint in a line comment, but there's probably more to discover. Try to inline code rather than using helper methods.
|
Done. I audited Simplifications made:
Validation:
Committed as |
Summary
data:/aria:container handling inAttributeHashso entries expand todata-*/aria-*String,Bool, and numeric values; omit attributes forNildata-*/aria-*attributes overridedata:/aria:entriesto_html_attrsTests
spec/instance_template/data_aria_attributes_spec.crcovering:to_html_attrs/named argsCRYSTAL_CACHE_DIR=/tmp/.crystal-cache-html crystal specCRYSTAL_CACHE_DIR=/tmp/.crystal-cache-html crystal spec spec/instance_template/data_aria_attributes_spec.cr