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

image_tag helper -> empty alt atrribute is removed but required for a11y #3222

Closed
Xaviju opened this issue Jul 31, 2018 · 2 comments
Closed
Labels

Comments

@Xaviju
Copy link

Xaviju commented Jul 31, 2018

Environment Info

Node version: v10.5.0

Hexo and Plugin version: hexo@3.7.1

Bug description

  1. BUG description
    For screen readers, is required to add an empty alt attribute (alt="") on images that are only decorative. It allows users with disabilities to read the page and avoid only-visual information. If a screen reader finds an image tag without an alt attribute will read the filename.

  2. The way to reproduce

<%- image_tag(gravatar(post.author.email), {
    alt: "",
    class: "post-author-image"
}) %>

generates a

<img src="image.png" class="post-author-image">

The expected behaviour would be

<img src="image.png" class="post-author-image" alt="">

Note If I add an empty string in the alt (alt=" ") it works as expected.

@stale
Copy link

stale bot commented Sep 29, 2018

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 29, 2018
@Xaviju
Copy link
Author

Xaviju commented Sep 29, 2018

Closing because it has been fixed

@Xaviju Xaviju closed this as completed Sep 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant