Markdown writer: proper rendering of empty map in YAML metadata.
Should be `{}` not empty string. Partially addresses #5398.
This commit is contained in:
parent
7fa5fbed9e
commit
ba613b2e9e
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue