diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-09-20 22:31:56 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-09-20 23:15:41 -0700 |
commit | 7b879f867ce0f90382f185a2e4b700b41ad73f9d (patch) | |
tree | fb3d60104dd95184625a188b9ad77c0bc4b47a10 /src/Text | |
parent | 7389919bb491b78373ea2197800988b3a61cf0ce (diff) | |
download | pandoc-7b879f867ce0f90382f185a2e4b700b41ad73f9d.tar.gz |
Changes to Slides to be more flexible with Div structure.
Previously if you had
```
::: #foo
c
:::
```
slide level would be 1, not 2.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Slides.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Slides.hs b/src/Text/Pandoc/Slides.hs index 8fb1b63aa..4a53a1c23 100644 --- a/src/Text/Pandoc/Slides.hs +++ b/src/Text/Pandoc/Slides.hs @@ -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 |