openlibhums / janeway

A web-based platform for publishing journals, preprints, conference proceedings, and books
https://janeway.systems/
GNU Affero General Public License v3.0
171 stars 63 forks source link

<img/> in rendered galleys should have alt attribute #1118

Closed hachacha closed 5 years ago

hachacha commented 5 years ago

Describe the bug No alt attribute in rendered img elements

Janeway version fd6a8f1a8df1d2061eccb213f743107b60372e86

To Reproduce Steps to reproduce the behavior:

  1. look at an article that has been published using pandoc + image upload
  2. no alt attribute :<

Screenshots image

Additional context We were asked to do an audit for accessibility to the site. Most things can be changed within our own theme but the images are being rendered (as you see above) in the galley and without the alt text which is important for impaired users of websites who will be using screen readers. Using the same text as the label when rendering the image would be sufficient I think. image

I tried to find where that code would be for a PR but got lost in the galleys. if you can direct me i will make that change.

ajrbyers commented 5 years ago

Hi @hachacha,

The core of janeway only handles uploading of the image files, the plugin generates the HTML where the alt text should be placed. If you want the core to edit the galley and place alt text based on the label of the uploaded image the place to start would be production.views.edit_galley and production.logic.save_galley_image.

hachacha commented 5 years ago

Ah, I see now. The pandoc plugin can handle alt text so if that is added during document creation it will end up in the galley. There are no changes that should happen to core or the plugin.