diff options
Diffstat (limited to 'src/Text/Pandoc/Writers/ConTeXt.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/ConTeXt.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index b19737a5e..85cb8e3d1 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -69,16 +69,16 @@ pandocToConTeXt options (Pandoc meta blocks) = do meta body <- mapM (elementToConTeXt options) $ hierarchicalize blocks let main = (render colwidth . vcat) body - let context = setField "toc" (writerTableOfContents options) - $ setField "placelist" (intercalate ("," :: String) $ + let context = defField "toc" (writerTableOfContents options) + $ defField "placelist" (intercalate ("," :: String) $ take (writerTOCDepth options + if writerChapters options then 0 else 1) ["chapter","section","subsection","subsubsection", "subsubsubsection","subsubsubsubsection"]) - $ setField "body" main - $ setField "number-sections" (writerNumberSections options) - $ setField "mainlang" (maybe "" + $ defField "body" main + $ defField "number-sections" (writerNumberSections options) + $ defField "mainlang" (maybe "" (reverse . takeWhile (/=',') . reverse) (lookup "lang" $ writerVariables options)) $ foldl (\acc (x,y) -> setField x y acc) |