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 duplicate alt attribute on Picture component. #6157

Merged
merged 2 commits into from
Feb 7, 2023

Conversation

chasm
Copy link
Contributor

@chasm chasm commented Feb 6, 2023

Changes

In packages/integrations/image/components/Picture.astro on line 44, {...image} already includes the alt attribute, so including it again creates a duplicate which causes the output to fail HTML validation: <img alt="" alt="" ...

Removing {alt} (see changes below) solves the problem.

Testing

Do you really want to add a test to test for duplicate attributes? The current tests should confirm that the alt attribute is not missing, which should be sufficient to prove that the {alt} code mentioned above was superfluous.

I ran the tests (thank you for using pnpm!) and they passed. I'm sure you'll run them, too.

Docs

There is no reason for this to be discussed in the docs. It's a simple mistake, and this PR fixes it.

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2023

🦋 Changeset detected

Latest commit: 4d5da9b

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: integration Related to any renderer integration (scope) label Feb 6, 2023
@chasm
Copy link
Contributor Author

chasm commented Feb 6, 2023

This is so tiny that it might be easier to just go make the change yourselves.

@natemoo-re
Copy link
Member

natemoo-re commented Feb 6, 2023

This is so tiny that it might be easier to just go make the change yourselves.

Nah, you wrote the fix, you should get credit! Thanks for contributing!!

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just waiting for CI to pass 😊

@chasm
Copy link
Contributor Author

chasm commented Feb 6, 2023 via email

@natemoo-re natemoo-re merged commit 460f9e7 into withastro:main Feb 7, 2023
@astrobot-houston astrobot-houston mentioned this pull request Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants