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

Behavior of the element's attributes changed after upgrading to 6 #1105

Closed
liram11 opened this issue Oct 26, 2022 · 1 comment
Closed

Behavior of the element's attributes changed after upgrading to 6 #1105

liram11 opened this issue Oct 26, 2022 · 1 comment

Comments

@liram11
Copy link

liram11 commented Oct 26, 2022

Hi, I noticed a strange difference in how haml treats attributes after upgrading from 5.2.2 to 6.0.7.

For example, this line:

%tagname{"data" => {"required" => "true"}, "data-required"=>nil} Contents

Will produce different results.

5.2.2:

<tagname>Contents</tagname>

6.0.7:

<tagname data-required="true">Contents</tagname>

I didn't find anything about that change in the changelog. Is it expected behavior?

@liram11 liram11 changed the title Behavior of input attributes changed after upgrading to 6 Behavior of element attributes changed after upgrading to 6 Oct 26, 2022
@liram11 liram11 changed the title Behavior of element attributes changed after upgrading to 6 Behavior of the element's attributes changed after upgrading to 6 Oct 26, 2022
@k0kubun
Copy link
Member

k0kubun commented Oct 29, 2022

It's an interesting finding.

As of the current version, I'd like to say that specifying the same attribute name multiple times is not supported in Haml 6. For example, I guess there's no valid use case to do %tagname{ :data => true, "data" => false }, and they look like the same thing to me.

You might have kindly minimized the example code for the issue-reporting purpose, which was indeed helpful, but I'd like to understand why you'd like to do this before re-introducing its support. Did your template really need to leverage this feature?

For now, I just added a changelog entry about this.

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

No branches or pull requests

2 participants