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

HTML writer: emit empty alt tag in figures #5518

Merged
merged 1 commit into from
May 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Text/Pandoc/Writers/HTML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ figure :: PandocMonad m
=> WriterOptions -> Attr -> [Inline] -> (String, String)
-> StateT WriterState m Html
figure opts attr txt (s,tit) = do
img <- inlineToHtml opts (Image attr txt (s,tit))
img <- inlineToHtml opts (Image attr [Str ""] (s,tit))
html5 <- gets stHtml5
let tocapt = if html5
then H5.figcaption
Expand Down
6 changes: 3 additions & 3 deletions test/command/3577.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
\end{figure}
^D
<figure>
<img src="img1.jpg" alt="Caption 1" /><figcaption>Caption 1</figcaption>
<img src="img1.jpg" alt="" /><figcaption>Caption 1</figcaption>
</figure>
<figure>
<img src="img2.jpg" alt="Caption 2" /><figcaption>Caption 2</figcaption>
<img src="img2.jpg" alt="" /><figcaption>Caption 2</figcaption>
</figure>
```
```
Expand All @@ -30,6 +30,6 @@
\end{figure}
^D
<figure>
<img src="img1.jpg" alt="Caption 3" /><figcaption>Caption 3</figcaption>
<img src="img1.jpg" alt="" /><figcaption>Caption 3</figcaption>
</figure>
```
2 changes: 1 addition & 1 deletion test/command/4677.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
![Caption](img.png){#img:1}
^D
<figure>
<img src="img.png" alt="Caption" id="img:1" /><figcaption>Caption</figcaption>
<img src="img.png" alt="" id="img:1" /><figcaption>Caption</figcaption>
</figure>
```
2 changes: 1 addition & 1 deletion test/command/5121.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Header 2
^D
<figure>
<img src="./my-figure.jpg" alt="My caption" width="500" /><figcaption>My caption</figcaption>
<img src="./my-figure.jpg" alt="" width="500" /><figcaption>My caption</figcaption>
</figure>

Header 2
Expand Down
2 changes: 1 addition & 1 deletion test/writer.html4
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ Blah
<h1 id="images">Images</h1>
<p>From “Voyage dans la Lune” by Georges Melies (1902):</p>
<div class="figure">
<img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune" />
<img src="lalune.jpg" title="Voyage dans la Lune" alt="" />
<p class="caption">lalune</p>
</div>
<p>Here is a movie <img src="movie.jpg" alt="movie" /> icon.</p>
Expand Down
2 changes: 1 addition & 1 deletion test/writer.html5
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ Blah
<h1 id="images">Images</h1>
<p>From “Voyage dans la Lune” by Georges Melies (1902):</p>
<figure>
<img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune" /><figcaption>lalune</figcaption>
<img src="lalune.jpg" title="Voyage dans la Lune" alt="" /><figcaption>lalune</figcaption>
</figure>
<p>Here is a movie <img src="movie.jpg" alt="movie" /> icon.</p>
<hr />
Expand Down