From 91436ebbf45d8d0891053ebdfbb837c71c4bf33a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 27 Oct 2022 12:22:23 -0700 Subject: T.P.Writers.Shared `toTableOfContents`: handle nested Divs better. Closes #8402. --- src/Text/Pandoc/Writers/Shared.hs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs index 3fe643e63..2b109c65d 100644 --- a/src/Text/Pandoc/Writers/Shared.hs +++ b/src/Text/Pandoc/Writers/Shared.hs @@ -454,6 +454,7 @@ sectionToListItem opts (Div (ident,_,_) then headerText' else [Link ("toc-" <> ident, [], []) headerText' ("#" <> ident, "")] listContents = filter (not . null) $ map (sectionToListItem opts) subsecs +sectionToListItem opts (Div _ [d@Div{}]) = sectionToListItem opts d -- #8402 sectionToListItem _ _ = [] -- | Returns 'True' iff the list of blocks has a @'Plain'@ as its last -- cgit v1.2.3