diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-01-05 09:35:40 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-01-05 09:42:35 -0800 |
commit | 0dff9b3cd2cd222e5eeebd880f38b38ad5ee58f0 (patch) | |
tree | 9ad8eb3ce5e2cfeace4902b96324002b60dbc2ef /src/Text | |
parent | b96febddef9d48318c3532ce1f484d0ee7367946 (diff) | |
download | pandoc-0dff9b3cd2cd222e5eeebd880f38b38ad5ee58f0.tar.gz |
Fix revealjs slide structure regression with certain slide levels.
Partially addresses #6030.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 6b9856b10..095d55c0e 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -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 |