diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2020-07-01 14:44:42 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2020-07-01 14:54:52 +0200 |
commit | b894de64264fe0386b5cb3e1680955a8e879c78e (patch) | |
tree | 49082151eed1efbe2b72756283335d6fc0a04310 /test/command/3577.md | |
parent | ccf9889c2c5839166be4296944c45447474f2a33 (diff) | |
download | pandoc-b894de64264fe0386b5cb3e1680955a8e879c78e.tar.gz |
HTML writer: improve alt-text/caption handling for HTML5
Screen readers read an image's `alt` attribute and the figure caption,
both of which come from the same source in pandoc. The figure caption is
hidden from screen readers with the `aria-hidden` attribute. This
improves accessibility.
For HTML4, where `aria-hidden` is not allowed, pandoc still uses an
empty `alt` attribute to avoid duplicate contents.
Closes: #6491
Diffstat (limited to 'test/command/3577.md')
-rw-r--r-- | test/command/3577.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/command/3577.md b/test/command/3577.md index d1df1610d..2f415146d 100644 --- a/test/command/3577.md +++ b/test/command/3577.md @@ -16,10 +16,10 @@ \end{figure} ^D <figure> -<img src="img1.jpg" alt="" /><figcaption>Caption 1</figcaption> +<img src="img1.jpg" alt="Caption 1" /><figcaption aria-hidden="true">Caption 1</figcaption> </figure> <figure> -<img src="img2.jpg" alt="" /><figcaption>Caption 2</figcaption> +<img src="img2.jpg" alt="Caption 2" /><figcaption aria-hidden="true">Caption 2</figcaption> </figure> ``` ``` @@ -30,6 +30,6 @@ \end{figure} ^D <figure> -<img src="img1.jpg" alt="" /><figcaption>Caption 3</figcaption> +<img src="img1.jpg" alt="Caption 3" /><figcaption aria-hidden="true">Caption 3</figcaption> </figure> ``` |