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

Better Image when things are not available #90

Merged
merged 1 commit into from
Dec 28, 2022

Conversation

jesse-deboer
Copy link
Contributor

Return null if there is no url available
Return empty string when there is no alt available

Return null if there is no url available
Return empty string when there is no alt available
@what-the-diff
Copy link

what-the-diff bot commented Dec 28, 2022

  • Added a check to see if the context has an url property.
  • If it doesn't, return null instead of trying to render the image tag with no src attribute (which would be invalid).
  • Changed how we set alt text on images so that they can now have empty values and still pass validation checks in browsers like Chrome which require all img tags to have an alt attribute present even if its value is blank or empty string ''

@jesse-deboer jesse-deboer merged commit 00b7507 into master Dec 28, 2022
@JeroenBoersma JeroenBoersma deleted the jesse-deboer-patch-2 branch January 26, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant