@@ -59,12 +59,14 @@ pandocToRST :: Pandoc -> State WriterState Doc
5959pandocToRST (Pandoc meta blocks) = do
6060 opts <- get >>= (return . stOptions)
6161 let before = writerIncludeBefore opts
62− let after = writerIncludeAfter opts
62+ after = writerIncludeAfter opts
63+ header = writerHeader opts
6364 before' = if null before then empty else text before
6465 after' = if null after then empty else text after
66+ header' = if null header then empty else text header
6567 metaBlock <- metaToRST opts meta
6668 let head' = if (writerStandalone opts)
67− then metaBlock $+$ text (writerHeader opts)
69+ then metaBlock $+$ header'
6870 else empty
6971 body <- blockListToRST blocks
7072 includes <- get >>= (return . concat . stIncludes)
@@ -129,6 +131,7 @@ escapeString = escapeStringUsing (backslashEscapes "`\\|*_")
129131
130132-- | Convert bibliographic information into RST header.
131133metaToRST :: WriterOptions -> Meta -> State WriterState Doc
134+metaToRST _ (Meta [] [] []) = return empty
132135metaToRST opts (Meta title authors date) = do
133136 title' <- titleToRST title
134137 authors' <- authorsToRST authors
@@ -136,7 +139,7 @@ metaToRST opts (Meta title authors date) = do
136139 let toc = if writerTableOfContents opts
137140 then text "" $+$ text ".. contents::"
138141 else empty
139− return $ title' $+$ authors' $+$ date' $+$ toc
142+ return $ title' $+$ authors' $+$ date' $+$ toc $+$ text ""
140143
141144titleToRST :: [Inline] -> State WriterState Doc
142145titleToRST [] = return empty