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(gatsby-remark-images): Do not fallback title value to alt value #37395

Merged
merged 1 commit into from
Jan 3, 2023

Conversation

tyhopp
Copy link
Contributor

@tyhopp tyhopp commented Jan 3, 2023

Description

While the HTML img spec does not mention the case of duplicate alt and title attributes on an img element (that I can find), MDN does mention we shouldn't do that so that screen readers do not make duplicate announcements.

The HTML spec general guidelines say that title is fine as supplemental information, so we want to keep the ability to set both alt and title, just not default the value of title to alt if title is not explicitly set in markdown.

Setting the default of title to an empty string means that the img element will not inherit from its parent, which is probably what we want by default to avoid unintended title inheritance. If users want a title they have the ability to set it directly.

Documentation

N/A

Related Issues

Resolves #37338

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 3, 2023
@tyhopp tyhopp added topic: remark/mdx Related to Markdown, remark & MDX ecosystem and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 3, 2023
@LekoArts LekoArts merged commit f6543bb into master Jan 3, 2023
@LekoArts LekoArts deleted the fix/gatsby-remark-images-title-attr branch January 3, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: remark/mdx Related to Markdown, remark & MDX ecosystem
Projects
None yet
2 participants