HTML writer: Don't produce HTML for table of contents if
there are no headers. (This would be an empty list, which is
invalid XHTML.)
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1011 788f1e2b-df1e-0410-8736-df70ead52e1b
commitd5e8ab71a49477db9e887499ed9513c7276ebbad
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>
dateWed 5 Sep 2007, 02:16 (19 years ago)
parent9726ec0
src/Text/Pandoc/Writers/HTML.hs+1
@@ -114,6 +114,7 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) =
114114-- | Construct table of contents from list of header blocks and identifiers.
115115-- Assumes there are as many identifiers as header blocks.
116116tableOfContents :: WriterOptions -> [Block] -> [String] -> Html
117+tableOfContents _ [] _ = noHtml
117118tableOfContents opts headers ids =
118119 let opts' = opts { writerIgnoreNotes = True }
119120 contentsTree = hierarchicalize headers