From 9a74c7b99bf0ac901f86bb38372a68e157cf9c73 Mon Sep 17 00:00:00 2001 From: Cameron Cundiff Date: Wed, 16 Aug 2017 14:34:02 -0400 Subject: Do not generate default alt text in image tags - Auto-generating content from the filename of an image is not suitable alternative text; alt text that isn't fully considered can be distracting and fatiguing for screen readers users (blind, low vision, dyslexic people). - Setting a filename fallback short circuits screen reader default behavior and configuration for blank descriptions. - Setting poor defaults also creates false negatives for accessibility linting and testing software, that makes it harder to improve application accessibility. *** - After this change, if authors leave images without alt text, screen readers will fallback to default behavior for missing alt text. - Also with this change, Automated linting and testing tools will correctly generate warnings. [Fixes #30096] --- guides/source/action_view_overview.md | 4 ++-- guides/source/api_documentation_guidelines.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'guides') diff --git a/guides/source/action_view_overview.md b/guides/source/action_view_overview.md index e5f4e0ec30..ea72567c03 100644 --- a/guides/source/action_view_overview.md +++ b/guides/source/action_view_overview.md @@ -414,7 +414,7 @@ By default, Rails links to these assets on the current host in the public folder ```ruby config.action_controller.asset_host = "assets.example.com" -image_tag("rails.png") # => Rails +image_tag("rails.png") # => ``` #### auto_discovery_link_tag @@ -453,7 +453,7 @@ image_url("edit.png") # => http://www.example.com/assets/edit.png Returns an HTML image tag for the source. The source can be a full path or a file that exists in your `app/assets/images` directory. ```ruby -image_tag("icon.png") # => Icon +image_tag("icon.png") # => ``` #### javascript_include_tag diff --git a/guides/source/api_documentation_guidelines.md b/guides/source/api_documentation_guidelines.md index c3c7367304..748e2c95b3 100644 --- a/guides/source/api_documentation_guidelines.md +++ b/guides/source/api_documentation_guidelines.md @@ -350,7 +350,7 @@ into account, one such example is ```ruby # image_tag("icon.png") -# # => Icon +# # => ``` Although the default behavior for `#image_tag` is to always return -- cgit v1.2.3