Skip to content

Fix attribute rendering for boolean values - #11369

Merged
bluwy merged 3 commits into
mainfrom
fix-attr-render
Jul 1, 2024
Merged

bluwy merged 3 commits into
mainfrom
fix-attr-render

Conversation

@bluwy

@bluwy bluwy commented Jun 28, 2024

Copy link
Copy Markdown
Member

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?

@changeset-bot

changeset-bot Bot commented Jun 28, 2024 •

Copy link
Copy Markdown

🦋 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
@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

Development

Successfully merging this pull request may close these issues.

There are different behaviors for custom attributes that do not start with data and attributes that start with data

2 participants

⌂ 换网址