diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-10-27 12:22:23 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-10-27 12:46:59 -0700 |
| commit | 91436ebbf45d8d0891053ebdfbb837c71c4bf33a (patch) | |
| tree | 233813aaf08647119c367a77a79310a893b594f5 /src/Text | |
| parent | 87f4247d9e95ee545c0654fc06e6e295da360221 (diff) | |
T.P.Writers.Shared `toTableOfContents`: handle nested Divs better.
Closes #8402.
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Writers/Shared.hs | 1 |
1 files changed, 1 insertions, 0 deletions
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 |
