Ensure that Nulls are ignored in creating slide shows.
Also ensure that Nulls are ignored in sectionification by `makeSections`. Closes #8155.
This commit is contained in:
parent
f2f9c896ee
commit
befa9d1301
3 changed files with 21 additions and 1 deletions
|
@ -589,6 +589,7 @@ makeSections numbering mbBaseLevel bs =
|
||||||
xs' <- go xs
|
xs' <- go xs
|
||||||
rest' <- go rest
|
rest' <- go rest
|
||||||
return $ Div attr xs' : rest'
|
return $ Div attr xs' : rest'
|
||||||
|
go (Null:xs) = go xs
|
||||||
go (x:xs) = (x :) <$> go xs
|
go (x:xs) = (x :) <$> go xs
|
||||||
go [] = return []
|
go [] = return []
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ getSlideLevel = go 6
|
||||||
|
|
||||||
-- | Prepare a block list to be passed to makeSections.
|
-- | Prepare a block list to be passed to makeSections.
|
||||||
prepSlides :: Int -> [Block] -> [Block]
|
prepSlides :: Int -> [Block] -> [Block]
|
||||||
prepSlides slideLevel = ensureStartWithH . splitHrule . extractRefsHeader
|
prepSlides slideLevel = ensureStartWithH . splitHrule . extractRefsHeader . filter (/= Null)
|
||||||
where splitHrule (HorizontalRule : Header n attr xs : ys)
|
where splitHrule (HorizontalRule : Header n attr xs : ys)
|
||||||
| n == slideLevel = Header slideLevel attr xs : splitHrule ys
|
| n == slideLevel = Header slideLevel attr xs : splitHrule ys
|
||||||
splitHrule (HorizontalRule : xs) = Header slideLevel nullAttr [Str "\0"] :
|
splitHrule (HorizontalRule : xs) = Header slideLevel nullAttr [Str "\0"] :
|
||||||
|
|
19
test/command/8155.md
Normal file
19
test/command/8155.md
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
```
|
||||||
|
% pandoc -f native -t revealjs
|
||||||
|
[ Null
|
||||||
|
, Header
|
||||||
|
2
|
||||||
|
( "header-after-null" , [] , [] )
|
||||||
|
[ Str "Header"
|
||||||
|
, Space
|
||||||
|
, Str "after"
|
||||||
|
, Space
|
||||||
|
, Str "null"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
^D
|
||||||
|
<section id="header-after-null" class="title-slide slide level2">
|
||||||
|
<h2>Header after null</h2>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
```
|
Loading…
Reference in a new issue