@@ -72,13 +72,15 @@ writeRTF options (Pandoc (Meta title authors date) blocks) =
7272 datetext = inlineListToRTF date
7373 spacer = not $ all null $ titletext : datetext : authorstext
7474 body = concatMap (blockToRTF 0 AlignDefault) blocks
75+ isTOCHeader (Header lev _) = lev <= writerTOCDepth options
76+ isTOCHeader _ = False
7577 context = writerVariables options ++
7678 [ ("body", body)
7779 , ("title", titletext)
7880 , ("date", datetext) ] ++
7981 [ ("author", a) | a <- authorstext ] ++
8082 [ ("spacer", "yes") | spacer ] ++
81− [ ("toc", tableOfContents $ filter isHeaderBlock blocks) |
83+ [ ("toc", tableOfContents $ filter isTOCHeader blocks) |
8284 writerTableOfContents options ]
8385 in if writerStandalone options
8486 then renderTemplate context $ writerTemplate options