Skip to content

Commit

Permalink
Commonmark implicit_figures should check for empty caption...
Browse files Browse the repository at this point in the history
...and not produce an implicit figure in this case.

Closes #10429.
  • Loading branch information
jgm committed Nov 30, 2024
1 parent 5f4c4ae commit 561e1de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Text/Pandoc/Readers/CommonMark.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ readCommonMark opts s
readCommonMarkBody opts sources toks

makeFigures :: Block -> Block
makeFigures (Para [Image (ident,classes,kvs) alt (src,tit)]) =
makeFigures (Para [Image (ident,classes,kvs) alt (src,tit)])
| not (null alt) =
Figure (ident,[],[])
(Caption Nothing [Plain alt])
[Plain [Image ("",classes,kvs) alt (src,tit)]]
Expand Down

0 comments on commit 561e1de

Please sign in to comment.