diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-01-09 03:13:08 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-01-09 03:13:08 +0000 |
commit | 2a4e5f9daa41eb726a66fc6bd94eea945bca9e24 (patch) | |
tree | 82489de76aa34365259c8e03d018060173b5c5c4 /src/Text/Pandoc/Writers | |
parent | 13a262af6a44412a71f8879b76fb040af2e3a25a (diff) | |
download | pandoc-2a4e5f9daa41eb726a66fc6bd94eea945bca9e24.tar.gz |
HTML writer: don't include empty UL if --toc but no sections.
Resolves Issue #199.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1799 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 7d6462148..cca65751f 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -160,7 +160,11 @@ tableOfContents _ [] = return noHtml tableOfContents opts sects = do let opts' = opts { writerIgnoreNotes = True } contents <- mapM (elementToListItem opts') sects - return $ thediv ! [prefixedId opts' "TOC"] $ unordList $ catMaybes contents + let tocList = catMaybes contents + return $ thediv ! [prefixedId opts' "TOC"] $ + if null tocList + then noHtml + else unordList tocList -- | Convert section number to string showSecNum :: [Int] -> String |