Shared: improve isTight.
If a list has an empty item, this should not count against
its being a tight list.
Closes #5857.
commit47566817c559557f5bc6c9c503afa1a37bf7df90
authorJohn MacFarlane <jgm@berkeley.edu>
dateMon 28 Oct 2019, 21:14 (7 years ago)
parent57e2148
src/Text/Pandoc/Shared.hs+1−1
@@ -623,7 +623,7 @@ onlySimpleTableCells = all isSimpleCell . concat
623623
624624-- | Detect if a list is tight.
625625isTightList :: [[Block]] -> Bool
626−isTightList = all firstIsPlain
626+isTightList = all (\item -> firstIsPlain item || null item)
627627 where firstIsPlain (Plain _ : _) = True
628628 firstIsPlain _ = False
629629
test/command/5857.mdnew file+11
@@ -0,0 +1,11 @@
1+```
2+% pandoc -f native -t markdown
3+[BulletList
4+ [[Plain [Str "a"]]
5+ ,[]
6+ ,[Plain [Str "b"]]]]
7+^D
8+- a
9+-
10+- b
11+```