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:
parent
57e2148ca2
commit
47566817c5
2 changed files with 12 additions and 1 deletions
|
@ -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
11
test/command/5857.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
```
|
||||
% pandoc -f native -t markdown
|
||||
[BulletList
|
||||
[[Plain [Str "a"]]
|
||||
,[]
|
||||
,[Plain [Str "b"]]]]
|
||||
^D
|
||||
- a
|
||||
-
|
||||
- b
|
||||
```
|
Loading…
Add table
Reference in a new issue