Changes to Slides to be more flexible with Div structure.
Previously if you had ``` ::: #foo c ::: ``` slide level would be 1, not 2.
This commit is contained in:
parent
7389919bb4
commit
7b879f867c
1 changed files with 3 additions and 0 deletions
|
@ -22,6 +22,7 @@ getSlideLevel = go 6
|
|||
where go least (Header n _ _ : x : xs)
|
||||
| n < least && nonHOrHR x = go n xs
|
||||
| otherwise = go least (x:xs)
|
||||
go least (Div _ bs : xs) = min (go least bs) (go least xs)
|
||||
go least (_ : xs) = go least xs
|
||||
go least [] = least
|
||||
nonHOrHR Header{} = False
|
||||
|
@ -45,4 +46,6 @@ prepSlides slideLevel = ensureStartWithH . splitHrule . extractRefsHeader
|
|||
_ -> bs
|
||||
ensureStartWithH bs@(Header n _ _:_)
|
||||
| n <= slideLevel = bs
|
||||
ensureStartWithH bs@(Div _ (Header n _ _:_) : _)
|
||||
| n <= slideLevel = bs
|
||||
ensureStartWithH bs = Header slideLevel nullAttr [Str "\0"] : bs
|
||||
|
|
Loading…
Add table
Reference in a new issue