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

Attributes with spaces are not quoted if the attribute was loaded without quotes #568

Closed
dylanstreb opened this issue Aug 27, 2024 · 3 comments
Assignees

Comments

@dylanstreb
Copy link
Contributor

1. Description

Attributes with spaces are not quoted if the attribute was loaded without quotes

3. Fiddle or Project

Fiddle: https://dotnetfiddle.net/qj0Iav

The output from HAP includes <div class=test cls>Text</div>. This should be <div class="test cls">Text</div>. The browser will interpret the current output as <div class="test" cls>Text</div> - i.e. the class is only "test", then there's a new cls attribute with no value.

This is an issue with minified input. The quotes around attributes are stripped if it is valid to do so. When HAP loads a minified attribute, it attempts to preserve the quotation style. However, if the value is then changed, it does not check to make sure that the quotation style is still legal.

The example uses addClass but it should apply to anything that modifies attribute values. I believe other characters besides just space will require quotations. I don't know the exact list but probably any non-word character.

4. Any further technical details

  • HAP version:
    Occurs in HAP 1.11.63 and 1.11.64
@JonathanMagnan JonathanMagnan self-assigned this Aug 27, 2024
@JonathanMagnan
Copy link
Member

Hello @dylanstreb ,

Thank you for reporting. We will look at it.

Best Regards,

Jon

JonathanMagnan added a commit that referenced this issue Aug 30, 2024
@JonathanMagnan
Copy link
Member

Hello @dylanstreb ,

The v1.11.65 has been released, fixing this issue.

Let me know if everything is now working correctly.

Best Regards,

Jon

@dylanstreb
Copy link
Contributor Author

1.11.65 fixes the issue. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants