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

Fix attribute rendering for boolean values #11369

Merged
merged 3 commits into from
Jul 1, 2024
Merged

Fix attribute rendering for boolean values #11369

merged 3 commits into from
Jul 1, 2024

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Jun 28, 2024

Changes

fix #11342

Makes sure that normal attributes (e.g. foobar={...}) and data attributes (.e.g data-foobar={...}) renders correctly if given true or false values, which now they will render as ="true" and ="false" respectively. Only known HTML boolean attributes can omit the value.

This refactor also enables reverting some fixes from #2538 as the base case covers the behaviour now.

Testing

Updated astro-attrs test

Docs

Added changeset. I think the changes are a bit subtle and shouldn't break anything, but do we want to to list an exhaustive example of how different values get rendered as what?

Copy link

changeset-bot bot commented Jun 28, 2024

🦋 Changeset detected

Latest commit: 1dd7efb

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jun 28, 2024
@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Jun 28, 2024
@bluwy bluwy merged commit e6de11f into main Jul 1, 2024
13 checks passed
@bluwy bluwy deleted the fix-attr-render branch July 1, 2024 07:27
@astrobot-houston astrobot-houston mentioned this pull request Jul 1, 2024
matthewp added a commit that referenced this pull request Jul 3, 2024
matthewp added a commit that referenced this pull request Jul 3, 2024
* Revert "Fix attribute rendering for boolean values (#11369)"

This reverts commit e6de11f.

* Add a changeset
ematipico pushed a commit that referenced this pull request Jul 18, 2024
* Revert "Fix attribute rendering for boolean values (#11369)"

This reverts commit e6de11f.

* Add a changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope)
Projects
None yet
2 participants