-
Notifications
You must be signed in to change notification settings - Fork 230
Add Tag.attributes_escape/1 #331
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
Add Tag.attributes_escape/1 #331
Conversation
| [32, "id", 61, 34, "the id", 34], | ||
| [32, "selected"] | ||
| ]} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should document that, opposite to tag and content_tag, the attributes are not sorted.
josevalim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment and we can ship it!
|
💚 💙 💜 💛 ❤️ |
|
@josevalim regarding accepting |
This PR adds a new function called
attributes_escape/1that will be used by the new template engine I'm working on. I'm not sure this function should be placed in theTagmodule since neithertagnorcontent_taguse it. However, I believe they should use it for consistency. The problem is that, currently, the implementation sorts the attributes, which makes no sense for the new engine as it generates groups of attributes separately based on their types (static key/value, static key + dynamic value and dynamic key/value).I can either move this function to someplace else or change the implementation of
tagandcontent_tagto use it. The latter might break existing code if, for any reason, the order of the attributes was taken into account, for instance, in tests.