Sort YAML metadata keys in Markdown output case-insensitive.
Use caseFold.
This commit is contained in:
parent
045dd212a7
commit
39f357027a
1 changed files with 2 additions and 2 deletions
|
@ -126,7 +126,7 @@ pandocTitleBlock tit auths dat =
|
|||
|
||||
mmdTitleBlock :: Context Text -> Doc Text
|
||||
mmdTitleBlock (Context hashmap) =
|
||||
vcat $ map go $ sortOn fst $ M.toList hashmap
|
||||
vcat $ map go $ sortOn (T.toCaseFold . fst) $ M.toList hashmap
|
||||
where go (k,v) =
|
||||
case (text (T.unpack k), v) of
|
||||
(k', ListVal xs)
|
||||
|
@ -155,7 +155,7 @@ yamlMetadataBlock v = "---" $$ contextToYaml v $$ "---"
|
|||
|
||||
contextToYaml :: Context Text -> Doc Text
|
||||
contextToYaml (Context o) =
|
||||
vcat $ map keyvalToYaml $ sortOn fst $ M.toList o
|
||||
vcat $ map keyvalToYaml $ sortOn (T.toCaseFold . fst) $ M.toList o
|
||||
where
|
||||
keyvalToYaml (k,v) =
|
||||
case (text (T.unpack k), v) of
|
||||
|
|
Loading…
Reference in a new issue