aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 4964fbad0..3850dccd2 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -149,7 +149,9 @@ jsonToYaml (Object hashmap) =
(k', Array vec, x)
| V.null vec -> empty
| otherwise -> (k' <> ":") $$ x
- (k', Object _, x) -> (k' <> ":") $$ nest 2 x
+ (k', Object hm, x)
+ | H.null hm -> k' <> ": {}"
+ | otherwise -> (k' <> ":") $$ nest 2 x
(_, String "", _) -> empty
(k', _, x) -> k' <> ":" <> space <> hang 2 "" x)
$ sortBy (comparing fst) $ H.toList hashmap