mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-25 17:05:41 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user