Shared: improve isTight.

If a list has an empty item, this should not count against
its being a tight list.

Closes #5857.
This commit is contained in:
John MacFarlane 2019-10-28 21:14:01 -07:00
parent 57e2148ca2
commit 47566817c5
2 changed files with 12 additions and 1 deletions

View file

@ -623,7 +623,7 @@ onlySimpleTableCells = all isSimpleCell . concat
-- | Detect if a list is tight.
isTightList :: [[Block]] -> Bool
isTightList = all firstIsPlain
isTightList = all (\item -> firstIsPlain item || null item)
where firstIsPlain (Plain _ : _) = True
firstIsPlain _ = False

11
test/command/5857.md Normal file
View file

@ -0,0 +1,11 @@
```
% pandoc -f native -t markdown
[BulletList
[[Plain [Str "a"]]
,[]
,[Plain [Str "b"]]]]
^D
- a
-
- b
```