@@ -114,6 +114,7 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) =
114-- | Construct table of contents from list of header blocks and identifiers.
114-- | Construct table of contents from list of header blocks and identifiers.
115-- Assumes there are as many identifiers as header blocks.
115-- Assumes there are as many identifiers as header blocks.
116tableOfContents :: WriterOptions -> [Block] -> [String] -> Html
116tableOfContents :: WriterOptions -> [Block] -> [String] -> Html
117+tableOfContents _ [] _ = noHtml
117tableOfContents opts headers ids =
118tableOfContents opts headers ids =
118 let opts' = opts { writerIgnoreNotes = True }
119 let opts' = opts { writerIgnoreNotes = True }
119 contentsTree = hierarchicalize headers
120 contentsTree = hierarchicalize headers