aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs1
-rw-r--r--test/command/10867.md26
2 files changed, 26 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 93ce8e937..9adff3597 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -721,7 +721,6 @@ blockToMarkdown' opts (Figure figattr capt body) = do
let combinedAttr imgattr = case imgattr of
("", cls, kv)
| (figid, [], []) <- figattr -> Just (figid, cls, kv)
- | otherwise -> Just ("", cls, kv)
_ -> Nothing
let combinedAlt alt = case capt of
Caption Nothing [] -> if null alt
diff --git a/test/command/10867.md b/test/command/10867.md
new file mode 100644
index 000000000..8852e1131
--- /dev/null
+++ b/test/command/10867.md
@@ -0,0 +1,26 @@
+```
+% pandoc -f native -t markdown-raw_html
+[ Figure
+ ( "fig:foo" , [] , [ ( "label" , "1.1" ) ] )
+ (Caption
+ Nothing
+ [ Plain
+ [ Str "Figure" , Space , Str "1.1:" , Space , Str "Figure" ]
+ ])
+ [ Plain
+ [ Image
+ ( "" , [] , [] )
+ [ Str "Figure" , Space , Str "1.1:" , Space , Str "Figure" ]
+ ( "./image.png" , "" )
+ ]
+ ]
+]
+^D
+:::: {#fig:foo .figure label="1.1"}
+![Figure 1.1: Figure](./image.png)
+
+::: caption
+Figure 1.1: Figure
+:::
+::::
+```