From a1f010de7830777b86f88743785560a04fab62fd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 29 Jun 2013 22:14:01 -0700 Subject: Metadata changes: Variables now completely shadow metadata. Previously if you set a value both in metadata and with a variable, they'd be combined into a list. Now the variable replaces the value in document metadata. If many variables with the same name are set, a list is created. Shared: metaToJSON now has an argument for a variable list. --- src/Text/Pandoc/Writers/ConTeXt.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Writers/ConTeXt.hs') diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index ac158b471..82d4fccec 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -66,6 +66,7 @@ pandocToConTeXt options (Pandoc meta blocks) = do metadata <- metaToJSON (fmap (render colwidth) . blockListToConTeXt) (fmap (render colwidth) . inlineListToConTeXt) + (writerVariables options) meta body <- mapM (elementToConTeXt options) $ hierarchicalize blocks let main = (render colwidth . vcat) body @@ -81,8 +82,7 @@ pandocToConTeXt options (Pandoc meta blocks) = do $ defField "mainlang" (maybe "" (reverse . takeWhile (/=',') . reverse) (lookup "lang" $ writerVariables options)) - $ foldl (\acc (x,y) -> setField x y acc) - metadata (writerVariables options) + $ metadata return $ if writerStandalone options then renderTemplate' (writerTemplate options) context else main -- cgit v1.2.3