From d5e8ab71a49477db9e887499ed9513c7276ebbad Mon Sep 17 00:00:00 2001
From: fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>
Date: Wed, 5 Sep 2007 02:16:50 +0000
Subject: 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
---
 src/Text/Pandoc/Writers/HTML.hs | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src')

diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 0b99c6c92..f554d4887 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -114,6 +114,7 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) =
 -- | Construct table of contents from list of header blocks and identifiers.
 -- Assumes there are as many identifiers as header blocks.
 tableOfContents :: WriterOptions -> [Block] -> [String] -> Html
+tableOfContents _ [] _ = noHtml
 tableOfContents opts headers ids =
   let opts'        = opts { writerIgnoreNotes = True }
       contentsTree = hierarchicalize headers
-- 
cgit v1.2.3