Fix revealjs slide structure regression with certain slide levels.

Partially addresses #6030.
This commit is contained in:
John MacFarlane
2020-01-05 09:42:35 -08:00
parent b96febddef
commit 0dff9b3cd2
2 changed files with 43 additions and 6 deletions
+8 -6
View File
@@ -676,13 +676,15 @@ blockToHtml opts (Div (ident, "section":dclasses, dkvs)
let attr = (ident, classes', dkvs)
if titleSlide
then do
t <- addAttrs opts attr $ secttag $ header' <> titleContents
t <- addAttrs opts attr $
secttag $ nl opts <> header' <> nl opts <> titleContents <> nl opts
return $
(if slideVariant == RevealJsSlides && not (null innerSecs)
-- revealjs doesn't like more than one level of section nesting:
{- REMOVED && isNothing mbparentlevel -}
then H5.section
else id) $ nl opts <> t <> nl opts <>
-- ensure 2D nesting for revealjs, but only for one level;
-- revealjs doesn't like more than one level of nseting
(if slideVariant == RevealJsSlides && not (null innerSecs) &&
level == slideLevel - 1
then \z -> H5.section (nl opts <> z)
else id) $ t <> nl opts <>
if null innerSecs
then mempty
else innerContents <> nl opts
+35
View File
@@ -0,0 +1,35 @@
```
% pandoc -t revealjs --slide-level=3
# One
One
## Two
Two
### Three
Three
#### Four
Four
^D
<section id="one" class="title-slide slide level1">
<h1>One</h1>
<p>One</p>
</section>
<section>
<section id="two" class="title-slide slide level2">
<h2>Two</h2>
<p>Two</p>
</section>
<section id="three" class="slide level3">
<h3>Three</h3>
<p>Three</p>
<h4 id="four">Four</h4>
<p>Four</p>
</section>
</section>
```