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 Text -> Doc Text
|
||||||
mmdTitleBlock (Context hashmap) =
|
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) =
|
where go (k,v) =
|
||||||
case (text (T.unpack k), v) of
|
case (text (T.unpack k), v) of
|
||||||
(k', ListVal xs)
|
(k', ListVal xs)
|
||||||
|
@ -155,7 +155,7 @@ yamlMetadataBlock v = "---" $$ contextToYaml v $$ "---"
|
||||||
|
|
||||||
contextToYaml :: Context Text -> Doc Text
|
contextToYaml :: Context Text -> Doc Text
|
||||||
contextToYaml (Context o) =
|
contextToYaml (Context o) =
|
||||||
vcat $ map keyvalToYaml $ sortOn fst $ M.toList o
|
vcat $ map keyvalToYaml $ sortOn (T.toCaseFold . fst) $ M.toList o
|
||||||
where
|
where
|
||||||
keyvalToYaml (k,v) =
|
keyvalToYaml (k,v) =
|
||||||
case (text (T.unpack k), v) of
|
case (text (T.unpack k), v) of
|
||||||
|
|
Loading…
Reference in a new issue