Closed teknetia closed 10 years ago
I'm not sure why you feel that the the specified caption should not be used as the figcaption
. The title and the caption are not the same thing, so substituting them here doesn't make sense.
If you have complex image needs that require more options regarding alternative text for the alt
attribute for better accessibility, then you can always use raw HTML. Markdown, and by extension MultiMarkdown, is designed to cover basic use cases. It doesn't cover everything that every user may need.
The information used for the caption can include Markdown markup such as bold/emph/etc. For this to work, it has to draw from the caption text, not the title text (which does not support markup).
You are, of course, welcome to modify the source to handle this situation however you see fit for your own needs.
When you insert an image in the document, particularly as a figure like the below example, the generated HTML is not accessible as it uses the
alt
andtitle
attributes incorrectly.![Image figure caption](path/to/img.jpg "Image title text")
In the example above the generated HTML is
The problem is that for a screen reader user or any user agent that doesn't support images the wrong information is given to the user. I am sure this was done to ensure
alt=""
always existed but it is incorrect use of the attributes and disadvantages a set of users.The correct usage is
alt
is the text displayed if the image can't be displayed and as such should describe the image or otherwise give that user context of what it is. Thetitle
attribute is the one that the figure caption should come from as this is the name of the image. There is a great write up about this at 456 Berea Street for reference.The correct output of the figure should be:
This change would of course cause many backwards compatability issues so that must be taken into account. I have a few ideas on how this could be handled. Of course all images are required to have an
alt
attribute so at a minimum an empty string should be added where nothing is provided.