git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: Don't include empty TOC items for slide shows.
4983083John MacFarlane
src/Text/Pandoc/Writers/HTML.hs+3
@@ -236,6 +236,9 @@ showSecNum = concat . intersperse "." . map show
236-- | Converts an Element to a list item for a table of contents,
236-- | Converts an Element to a list item for a table of contents,
237-- retrieving the appropriate identifier from state.
237-- retrieving the appropriate identifier from state.
238elementToListItem :: WriterOptions -> Element -> State WriterState (Maybe Html)
238elementToListItem :: WriterOptions -> Element -> State WriterState (Maybe Html)
239+-- Don't include the empty headers created in slide shows
240+-- shows when an hrule is used to separate slides without a new title:
241+elementToListItem _ (Sec _ _ _ [Str "\0"] _) = return Nothing
239elementToListItem opts (Sec lev num (id',classes,_) headerText subsecs)
242elementToListItem opts (Sec lev num (id',classes,_) headerText subsecs)
240 | lev <= writerTOCDepth opts = do
243 | lev <= writerTOCDepth opts = do
241 let num' = zipWith (+) num (writerNumberOffset opts ++ repeat 0)
244 let num' = zipWith (+) num (writerNumberOffset opts ++ repeat 0)