diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-09-05 02:16:50 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-09-05 02:16:50 +0000 |
commit | d5e8ab71a49477db9e887499ed9513c7276ebbad (patch) | |
tree | d6f9edd046615930e2bf218c7231a5da1fae1869 /src | |
parent | 9726ec04f587d74a5ef7123cb84d882d0f123300 (diff) | |
download | pandoc-d5e8ab71a49477db9e887499ed9513c7276ebbad.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 1 |
1 files changed, 1 insertions, 0 deletions
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 |