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
This commit is contained in:
fiddlosopher
2010-01-09 03:13:08 +00:00
parent 13a262af6a
commit 2a4e5f9daa
+5 -1
View File
@@ -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