aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-03-07 10:09:17 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-03-07 10:09:17 -0800
commit8a8d4a8abc4e24de814d4c610c8160033462694c (patch)
treedc756c10432c99010508c2e33e26e2ec88e542a3 /src
parent0cadc5f7574b8d9bdfa8cb9f9a87da98eabe96b5 (diff)
downloadpandoc-8a8d4a8abc4e24de814d4c610c8160033462694c.tar.gz
Set mainlang variable in context writer.
This parallels behavior of latex writer. Mainlang is the last of a comma-separated list of languages in lang.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index dfdf7a140..b612b9904 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -77,6 +77,8 @@ pandocToConTeXt options (Pandoc (Meta title authors date) blocks) = do
, ("title", titletext)
, ("date", datetext) ] ++
[ ("number-sections", "yes") | writerNumberSections options ] ++
+ [ ("mainlang", maybe "" (reverse . takeWhile (/=',') . reverse)
+ (lookup "lang" $ writerVariables options)) ] ++
[ ("author", a) | a <- authorstext ]
return $ if writerStandalone options
then renderTemplate context $ writerTemplate options