aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Writers
diff options
context:
space:
mode:
authorEmily Bourke <undergroundquizscene@protonmail.com>2021-08-20 14:40:09 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2021-08-27 09:47:03 -0700
commit8e5a79f264dd1ebe80e048397b6281e318d25e82 (patch)
treec55e64b8e59243aa9168906c2892ec0827c6b8c5 /test/Tests/Writers
parente4d7a6177f6ef7bf835f61ed01b0229423cd0e55 (diff)
downloadpandoc-8e5a79f264dd1ebe80e048397b6281e318d25e82.tar.gz
pptx: Make first heading title if slide level is 0
Before this commit, the pptx writer adds a slide break before any table, “columns” div, or paragraph starting with an image, unless the only thing before it on the same slide is a heading at the slide level. In that case, the item and heading are kept on the same slide, and the heading is used as the slide title (inserted into the layout’s “title” placeholder). However, if the slide level is set to 0 (as was recently enabled) this makes it impossible to have a slide with a title which contains any of those items in its body. This commit changes this behaviour: now if the slide level is 0, then items will be kept with a heading of any level, if the heading’s the only thing before the item on the same slide.
Diffstat (limited to 'test/Tests/Writers')
-rw-r--r--test/Tests/Writers/Powerpoint.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs
index 344d20238..fd6d01d2d 100644
--- a/test/Tests/Writers/Powerpoint.hs
+++ b/test/Tests/Writers/Powerpoint.hs
@@ -146,4 +146,29 @@ tests = groupPptxTests [ pptxTests "Inline formatting"
[(pack "monofont", toVal $ pack "Consolas")] }
"pptx/code.native"
"pptx/code-custom.pptx"
+ , pptxTests ("Using slide level 0, if the first thing on "
+ <> "a slide is a h1 it's used as the "
+ <> "slide title")
+ def { writerSlideLevel = Just 0 }
+ "pptx/slide-level-0-h1-with-image.native"
+ "pptx/slide-level-0-h1-with-image.pptx"
+ , pptxTests ("Using slide level 0, if the first thing on "
+ <> "a slide is a h2 it's used as the "
+ <> "slide title")
+ def { writerSlideLevel = Just 0 }
+ "pptx/slide-level-0-h2-with-image.native"
+ "pptx/slide-level-0-h2-with-image.pptx"
+ , pptxTests ("Using slide level 0, if the first thing on "
+ <> "a slide is a heading it's used as the "
+ <> "slide title (works with a table)")
+ def { writerSlideLevel = Just 0 }
+ "pptx/slide-level-0-h1-with-table.native"
+ "pptx/slide-level-0-h1-with-table.pptx"
+ , pptxTests ("Using slide level 0, if the first thing on "
+ <> "a slide is a heading it's used as the "
+ <> "slide title (two headings forces a "
+ <> "slide break though)")
+ def { writerSlideLevel = Just 0 }
+ "pptx/slide-level-0-h1-h2-with-table.native"
+ "pptx/slide-level-0-h1-h2-with-table.pptx"
]