parent
5295607de7
commit
0b54d6282b
2 changed files with 18 additions and 3 deletions
|
@ -407,9 +407,9 @@ toTableOfContents opts bs =
|
|||
sectionToListItem :: WriterOptions -> Block -> [Block]
|
||||
sectionToListItem opts (Div (ident,_,_)
|
||||
(Header lev (_,classes,kvs) ils : subsecs))
|
||||
| not (isNothing (lookup "number" kvs) && "unlisted" `elem` classes)
|
||||
= Plain headerLink : [BulletList listContents | not (null listContents)
|
||||
, lev < writerTOCDepth opts]
|
||||
| lev <= writerTOCDepth opts
|
||||
, not (isNothing (lookup "number" kvs) && "unlisted" `elem` classes)
|
||||
= Plain headerLink : [BulletList listContents | not (null listContents)]
|
||||
where
|
||||
num = fromMaybe "" $ lookup "number" kvs
|
||||
addNumber = if T.null num
|
||||
|
|
15
test/command/5967.md
Normal file
15
test/command/5967.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
```
|
||||
% pandoc --toc --toc-depth=3 -s -t plain
|
||||
# One
|
||||
## Two
|
||||
#### Four
|
||||
^D
|
||||
- One
|
||||
- Two
|
||||
|
||||
One
|
||||
|
||||
Two
|
||||
|
||||
Four
|
||||
```
|
Loading…
Add table
Reference in a new issue