From 72823ad947face43ef45eaeb7e611979531abed6 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Tue, 10 Aug 2021 17:20:53 +0100 Subject: pptx: Select layouts from reference doc by name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now, users had to make sure that their reference doc contains layouts in a specific order: the first four layouts in the file had to have a specific structure, or else pandoc would error (or sometimes successfully produce a pptx file, which PowerPoint would then fail to open). This commit changes the layout selection to use the layout names rather than order: users must make sure their reference doc contains four layouts with specific names, and if a layout with the right name isn’t found pandoc will output a warning and use the corresponding layout from the default reference doc as a fallback. I believe the use of names rather than order will be clearer to users, and the clearer errors will help them troubleshoot when things go wrong. - Add tests for moved layouts - Add tests for deleted layouts - Add newly included layouts to slideMaster1.xml to fix tests --- test/pptx/code-custom_deleted_layouts.pptx | Bin 0 -> 31033 bytes test/pptx/code-custom_moved_layouts.pptx | Bin 0 -> 41822 bytes test/pptx/code_deleted_layouts.pptx | Bin 0 -> 31032 bytes test/pptx/code_moved_layouts.pptx | Bin 0 -> 41826 bytes .../document-properties-short-desc_deleted_layouts.pptx | Bin 0 -> 29806 bytes .../document-properties-short-desc_moved_layouts.pptx | Bin 0 -> 40600 bytes test/pptx/document-properties_deleted_layouts.pptx | Bin 0 -> 30210 bytes test/pptx/document-properties_moved_layouts.pptx | Bin 0 -> 41004 bytes test/pptx/endnotes_deleted_layouts.pptx | Bin 0 -> 29774 bytes test/pptx/endnotes_moved_layouts.pptx | Bin 0 -> 40566 bytes test/pptx/endnotes_toc_deleted_layouts.pptx | Bin 0 -> 30596 bytes test/pptx/endnotes_toc_moved_layouts.pptx | Bin 0 -> 41384 bytes test/pptx/images_deleted_layouts.pptx | Bin 0 -> 47424 bytes test/pptx/images_moved_layouts.pptx | Bin 0 -> 58213 bytes test/pptx/inline_formatting_deleted_layouts.pptx | Bin 0 -> 28966 bytes test/pptx/inline_formatting_moved_layouts.pptx | Bin 0 -> 39758 bytes test/pptx/lists_deleted_layouts.pptx | Bin 0 -> 29861 bytes test/pptx/lists_moved_layouts.pptx | Bin 0 -> 40653 bytes test/pptx/raw_ooxml_deleted_layouts.pptx | Bin 0 -> 29754 bytes test/pptx/raw_ooxml_moved_layouts.pptx | Bin 0 -> 40546 bytes test/pptx/reference_deleted_layouts.pptx | Bin 0 -> 18160 bytes test/pptx/reference_moved_layouts.pptx | Bin 0 -> 44237 bytes test/pptx/remove_empty_slides_deleted_layouts.pptx | Bin 0 -> 46867 bytes test/pptx/remove_empty_slides_moved_layouts.pptx | Bin 0 -> 57656 bytes test/pptx/slide_breaks_deleted_layouts.pptx | Bin 0 -> 31378 bytes test/pptx/slide_breaks_moved_layouts.pptx | Bin 0 -> 42171 bytes .../slide_breaks_slide_level_1_deleted_layouts.pptx | Bin 0 -> 30554 bytes test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx | Bin 0 -> 41343 bytes test/pptx/slide_breaks_toc_deleted_layouts.pptx | Bin 0 -> 32328 bytes test/pptx/slide_breaks_toc_moved_layouts.pptx | Bin 0 -> 43118 bytes .../speaker_notes_after_metadata_deleted_layouts.pptx | Bin 0 -> 34473 bytes .../speaker_notes_after_metadata_moved_layouts.pptx | Bin 0 -> 45269 bytes .../pptx/speaker_notes_afterheader_deleted_layouts.pptx | Bin 0 -> 33500 bytes test/pptx/speaker_notes_afterheader_moved_layouts.pptx | Bin 0 -> 44297 bytes test/pptx/speaker_notes_afterseps_deleted_layouts.pptx | Bin 0 -> 54390 bytes test/pptx/speaker_notes_afterseps_moved_layouts.pptx | Bin 0 -> 65181 bytes test/pptx/speaker_notes_deleted_layouts.pptx | Bin 0 -> 38203 bytes test/pptx/speaker_notes_moved_layouts.pptx | Bin 0 -> 49002 bytes test/pptx/start_numbering_at_deleted_layouts.pptx | Bin 0 -> 29837 bytes test/pptx/start_numbering_at_moved_layouts.pptx | Bin 0 -> 40630 bytes test/pptx/tables_deleted_layouts.pptx | Bin 0 -> 30381 bytes test/pptx/tables_moved_layouts.pptx | Bin 0 -> 41174 bytes test/pptx/two_column_deleted_layouts.pptx | Bin 0 -> 28883 bytes test/pptx/two_column_moved_layouts.pptx | Bin 0 -> 39676 bytes 44 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/pptx/code-custom_deleted_layouts.pptx create mode 100644 test/pptx/code-custom_moved_layouts.pptx create mode 100644 test/pptx/code_deleted_layouts.pptx create mode 100644 test/pptx/code_moved_layouts.pptx create mode 100644 test/pptx/document-properties-short-desc_deleted_layouts.pptx create mode 100644 test/pptx/document-properties-short-desc_moved_layouts.pptx create mode 100644 test/pptx/document-properties_deleted_layouts.pptx create mode 100644 test/pptx/document-properties_moved_layouts.pptx create mode 100644 test/pptx/endnotes_deleted_layouts.pptx create mode 100644 test/pptx/endnotes_moved_layouts.pptx create mode 100644 test/pptx/endnotes_toc_deleted_layouts.pptx create mode 100644 test/pptx/endnotes_toc_moved_layouts.pptx create mode 100644 test/pptx/images_deleted_layouts.pptx create mode 100644 test/pptx/images_moved_layouts.pptx create mode 100644 test/pptx/inline_formatting_deleted_layouts.pptx create mode 100644 test/pptx/inline_formatting_moved_layouts.pptx create mode 100644 test/pptx/lists_deleted_layouts.pptx create mode 100644 test/pptx/lists_moved_layouts.pptx create mode 100644 test/pptx/raw_ooxml_deleted_layouts.pptx create mode 100644 test/pptx/raw_ooxml_moved_layouts.pptx create mode 100644 test/pptx/reference_deleted_layouts.pptx create mode 100644 test/pptx/reference_moved_layouts.pptx create mode 100644 test/pptx/remove_empty_slides_deleted_layouts.pptx create mode 100644 test/pptx/remove_empty_slides_moved_layouts.pptx create mode 100644 test/pptx/slide_breaks_deleted_layouts.pptx create mode 100644 test/pptx/slide_breaks_moved_layouts.pptx create mode 100644 test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx create mode 100644 test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx create mode 100644 test/pptx/slide_breaks_toc_deleted_layouts.pptx create mode 100644 test/pptx/slide_breaks_toc_moved_layouts.pptx create mode 100644 test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx create mode 100644 test/pptx/speaker_notes_after_metadata_moved_layouts.pptx create mode 100644 test/pptx/speaker_notes_afterheader_deleted_layouts.pptx create mode 100644 test/pptx/speaker_notes_afterheader_moved_layouts.pptx create mode 100644 test/pptx/speaker_notes_afterseps_deleted_layouts.pptx create mode 100644 test/pptx/speaker_notes_afterseps_moved_layouts.pptx create mode 100644 test/pptx/speaker_notes_deleted_layouts.pptx create mode 100644 test/pptx/speaker_notes_moved_layouts.pptx create mode 100644 test/pptx/start_numbering_at_deleted_layouts.pptx create mode 100644 test/pptx/start_numbering_at_moved_layouts.pptx create mode 100644 test/pptx/tables_deleted_layouts.pptx create mode 100644 test/pptx/tables_moved_layouts.pptx create mode 100644 test/pptx/two_column_deleted_layouts.pptx create mode 100644 test/pptx/two_column_moved_layouts.pptx (limited to 'test/pptx') diff --git a/test/pptx/code-custom_deleted_layouts.pptx b/test/pptx/code-custom_deleted_layouts.pptx new file mode 100644 index 000000000..9282e6354 Binary files /dev/null and b/test/pptx/code-custom_deleted_layouts.pptx differ diff --git a/test/pptx/code-custom_moved_layouts.pptx b/test/pptx/code-custom_moved_layouts.pptx new file mode 100644 index 000000000..a14eeb6c8 Binary files /dev/null and b/test/pptx/code-custom_moved_layouts.pptx differ diff --git a/test/pptx/code_deleted_layouts.pptx b/test/pptx/code_deleted_layouts.pptx new file mode 100644 index 000000000..0f503f553 Binary files /dev/null and b/test/pptx/code_deleted_layouts.pptx differ diff --git a/test/pptx/code_moved_layouts.pptx b/test/pptx/code_moved_layouts.pptx new file mode 100644 index 000000000..4d66b1310 Binary files /dev/null and b/test/pptx/code_moved_layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc_deleted_layouts.pptx b/test/pptx/document-properties-short-desc_deleted_layouts.pptx new file mode 100644 index 000000000..e4cf6bd7b Binary files /dev/null and b/test/pptx/document-properties-short-desc_deleted_layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc_moved_layouts.pptx b/test/pptx/document-properties-short-desc_moved_layouts.pptx new file mode 100644 index 000000000..8834f885f Binary files /dev/null and b/test/pptx/document-properties-short-desc_moved_layouts.pptx differ diff --git a/test/pptx/document-properties_deleted_layouts.pptx b/test/pptx/document-properties_deleted_layouts.pptx new file mode 100644 index 000000000..a00c8059d Binary files /dev/null and b/test/pptx/document-properties_deleted_layouts.pptx differ diff --git a/test/pptx/document-properties_moved_layouts.pptx b/test/pptx/document-properties_moved_layouts.pptx new file mode 100644 index 000000000..c1d2d5282 Binary files /dev/null and b/test/pptx/document-properties_moved_layouts.pptx differ diff --git a/test/pptx/endnotes_deleted_layouts.pptx b/test/pptx/endnotes_deleted_layouts.pptx new file mode 100644 index 000000000..5c69a6310 Binary files /dev/null and b/test/pptx/endnotes_deleted_layouts.pptx differ diff --git a/test/pptx/endnotes_moved_layouts.pptx b/test/pptx/endnotes_moved_layouts.pptx new file mode 100644 index 000000000..0d4c491b9 Binary files /dev/null and b/test/pptx/endnotes_moved_layouts.pptx differ diff --git a/test/pptx/endnotes_toc_deleted_layouts.pptx b/test/pptx/endnotes_toc_deleted_layouts.pptx new file mode 100644 index 000000000..46708544c Binary files /dev/null and b/test/pptx/endnotes_toc_deleted_layouts.pptx differ diff --git a/test/pptx/endnotes_toc_moved_layouts.pptx b/test/pptx/endnotes_toc_moved_layouts.pptx new file mode 100644 index 000000000..d1200bd7d Binary files /dev/null and b/test/pptx/endnotes_toc_moved_layouts.pptx differ diff --git a/test/pptx/images_deleted_layouts.pptx b/test/pptx/images_deleted_layouts.pptx new file mode 100644 index 000000000..7a38ea625 Binary files /dev/null and b/test/pptx/images_deleted_layouts.pptx differ diff --git a/test/pptx/images_moved_layouts.pptx b/test/pptx/images_moved_layouts.pptx new file mode 100644 index 000000000..08d1c27e0 Binary files /dev/null and b/test/pptx/images_moved_layouts.pptx differ diff --git a/test/pptx/inline_formatting_deleted_layouts.pptx b/test/pptx/inline_formatting_deleted_layouts.pptx new file mode 100644 index 000000000..bbd5bfeb4 Binary files /dev/null and b/test/pptx/inline_formatting_deleted_layouts.pptx differ diff --git a/test/pptx/inline_formatting_moved_layouts.pptx b/test/pptx/inline_formatting_moved_layouts.pptx new file mode 100644 index 000000000..427492130 Binary files /dev/null and b/test/pptx/inline_formatting_moved_layouts.pptx differ diff --git a/test/pptx/lists_deleted_layouts.pptx b/test/pptx/lists_deleted_layouts.pptx new file mode 100644 index 000000000..6512e44bb Binary files /dev/null and b/test/pptx/lists_deleted_layouts.pptx differ diff --git a/test/pptx/lists_moved_layouts.pptx b/test/pptx/lists_moved_layouts.pptx new file mode 100644 index 000000000..2947c3211 Binary files /dev/null and b/test/pptx/lists_moved_layouts.pptx differ diff --git a/test/pptx/raw_ooxml_deleted_layouts.pptx b/test/pptx/raw_ooxml_deleted_layouts.pptx new file mode 100644 index 000000000..2ea155657 Binary files /dev/null and b/test/pptx/raw_ooxml_deleted_layouts.pptx differ diff --git a/test/pptx/raw_ooxml_moved_layouts.pptx b/test/pptx/raw_ooxml_moved_layouts.pptx new file mode 100644 index 000000000..e58304172 Binary files /dev/null and b/test/pptx/raw_ooxml_moved_layouts.pptx differ diff --git a/test/pptx/reference_deleted_layouts.pptx b/test/pptx/reference_deleted_layouts.pptx new file mode 100644 index 000000000..a9a74ecd5 Binary files /dev/null and b/test/pptx/reference_deleted_layouts.pptx differ diff --git a/test/pptx/reference_moved_layouts.pptx b/test/pptx/reference_moved_layouts.pptx new file mode 100644 index 000000000..72c4f3fd7 Binary files /dev/null and b/test/pptx/reference_moved_layouts.pptx differ diff --git a/test/pptx/remove_empty_slides_deleted_layouts.pptx b/test/pptx/remove_empty_slides_deleted_layouts.pptx new file mode 100644 index 000000000..7ae4a5fab Binary files /dev/null and b/test/pptx/remove_empty_slides_deleted_layouts.pptx differ diff --git a/test/pptx/remove_empty_slides_moved_layouts.pptx b/test/pptx/remove_empty_slides_moved_layouts.pptx new file mode 100644 index 000000000..2572f2447 Binary files /dev/null and b/test/pptx/remove_empty_slides_moved_layouts.pptx differ diff --git a/test/pptx/slide_breaks_deleted_layouts.pptx b/test/pptx/slide_breaks_deleted_layouts.pptx new file mode 100644 index 000000000..86dfad3b2 Binary files /dev/null and b/test/pptx/slide_breaks_deleted_layouts.pptx differ diff --git a/test/pptx/slide_breaks_moved_layouts.pptx b/test/pptx/slide_breaks_moved_layouts.pptx new file mode 100644 index 000000000..90b3b94a6 Binary files /dev/null and b/test/pptx/slide_breaks_moved_layouts.pptx differ diff --git a/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx b/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx new file mode 100644 index 000000000..2c7fd4d8b Binary files /dev/null and b/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx differ diff --git a/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx b/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx new file mode 100644 index 000000000..8471b1d10 Binary files /dev/null and b/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx differ diff --git a/test/pptx/slide_breaks_toc_deleted_layouts.pptx b/test/pptx/slide_breaks_toc_deleted_layouts.pptx new file mode 100644 index 000000000..1e0b76d46 Binary files /dev/null and b/test/pptx/slide_breaks_toc_deleted_layouts.pptx differ diff --git a/test/pptx/slide_breaks_toc_moved_layouts.pptx b/test/pptx/slide_breaks_toc_moved_layouts.pptx new file mode 100644 index 000000000..918264bc5 Binary files /dev/null and b/test/pptx/slide_breaks_toc_moved_layouts.pptx differ diff --git a/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx b/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx new file mode 100644 index 000000000..1298870e2 Binary files /dev/null and b/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx differ diff --git a/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx b/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx new file mode 100644 index 000000000..b844a0b51 Binary files /dev/null and b/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx b/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx new file mode 100644 index 000000000..853b918cb Binary files /dev/null and b/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterheader_moved_layouts.pptx b/test/pptx/speaker_notes_afterheader_moved_layouts.pptx new file mode 100644 index 000000000..9fff9f855 Binary files /dev/null and b/test/pptx/speaker_notes_afterheader_moved_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx b/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx new file mode 100644 index 000000000..1e7f4968d Binary files /dev/null and b/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterseps_moved_layouts.pptx b/test/pptx/speaker_notes_afterseps_moved_layouts.pptx new file mode 100644 index 000000000..e092ae444 Binary files /dev/null and b/test/pptx/speaker_notes_afterseps_moved_layouts.pptx differ diff --git a/test/pptx/speaker_notes_deleted_layouts.pptx b/test/pptx/speaker_notes_deleted_layouts.pptx new file mode 100644 index 000000000..6a5ad524f Binary files /dev/null and b/test/pptx/speaker_notes_deleted_layouts.pptx differ diff --git a/test/pptx/speaker_notes_moved_layouts.pptx b/test/pptx/speaker_notes_moved_layouts.pptx new file mode 100644 index 000000000..f95df9622 Binary files /dev/null and b/test/pptx/speaker_notes_moved_layouts.pptx differ diff --git a/test/pptx/start_numbering_at_deleted_layouts.pptx b/test/pptx/start_numbering_at_deleted_layouts.pptx new file mode 100644 index 000000000..d9cf91804 Binary files /dev/null and b/test/pptx/start_numbering_at_deleted_layouts.pptx differ diff --git a/test/pptx/start_numbering_at_moved_layouts.pptx b/test/pptx/start_numbering_at_moved_layouts.pptx new file mode 100644 index 000000000..e1b2d4de8 Binary files /dev/null and b/test/pptx/start_numbering_at_moved_layouts.pptx differ diff --git a/test/pptx/tables_deleted_layouts.pptx b/test/pptx/tables_deleted_layouts.pptx new file mode 100644 index 000000000..a52222551 Binary files /dev/null and b/test/pptx/tables_deleted_layouts.pptx differ diff --git a/test/pptx/tables_moved_layouts.pptx b/test/pptx/tables_moved_layouts.pptx new file mode 100644 index 000000000..56608a039 Binary files /dev/null and b/test/pptx/tables_moved_layouts.pptx differ diff --git a/test/pptx/two_column_deleted_layouts.pptx b/test/pptx/two_column_deleted_layouts.pptx new file mode 100644 index 000000000..60a244f94 Binary files /dev/null and b/test/pptx/two_column_deleted_layouts.pptx differ diff --git a/test/pptx/two_column_moved_layouts.pptx b/test/pptx/two_column_moved_layouts.pptx new file mode 100644 index 000000000..a17f96b18 Binary files /dev/null and b/test/pptx/two_column_moved_layouts.pptx differ -- cgit v1.2.3 From 5616d00d09d3a940364befd380dde328c6ac1a08 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Wed, 18 Aug 2021 10:13:54 +0100 Subject: pptx: Include image title in description The image title (i.e. `![alt text](link "title")`) was previously ignored when writing to pptx. This commit includes it in PowerPoint's description of the image, along with the link (which was already included). Fixes 7352. --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 13 +++++++++---- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 18 ++++++++++-------- test/pptx/images.pptx | Bin 44579 -> 44596 bytes test/pptx/images_deleted_layouts.pptx | Bin 47424 -> 47437 bytes test/pptx/images_moved_layouts.pptx | Bin 58213 -> 58160 bytes test/pptx/images_templated.pptx | Bin 57729 -> 57660 bytes test/pptx/speaker_notes_afterseps.pptx | Bin 51548 -> 51557 bytes .../speaker_notes_afterseps_deleted_layouts.pptx | Bin 54390 -> 54396 bytes .../pptx/speaker_notes_afterseps_moved_layouts.pptx | Bin 65181 -> 65121 bytes test/pptx/speaker_notes_afterseps_templated.pptx | Bin 64695 -> 64619 bytes 10 files changed, 19 insertions(+), 12 deletions(-) (limited to 'test/pptx') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index e0eb72161..0e6a67861 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -872,9 +872,10 @@ makePicElements :: PandocMonad m => Element -> PicProps -> MediaInfo + -> Text -> [ParaElem] -> P m [Element] -makePicElements layout picProps mInfo alt = do +makePicElements layout picProps mInfo titleText alt = do opts <- asks envOpts (pageWidth, pageHeight) <- asks envPresentationSize -- hasHeader <- asks envSlideHasHeader @@ -907,7 +908,11 @@ makePicElements layout picProps mInfo alt = do ,("noChangeAspect","1")] () -- cNvPr will contain the link information so we do that separately, -- and register the link if necessary. - let cNvPrAttr = [("descr", T.pack $ mInfoFilePath mInfo), + let description = (if T.null titleText + then "" + else titleText <> "\n\n") + <> T.pack (mInfoFilePath mInfo) + let cNvPrAttr = [("descr", description), ("id","0"), ("name","Picture 1")] cNvPr <- case picPropLink picProps of @@ -1106,11 +1111,11 @@ shapeToElement layout (TextBox paras) shapeToElement _ _ = return $ mknode "p:sp" [] () shapeToElements :: PandocMonad m => Element -> Shape -> P m [Content] -shapeToElements layout (Pic picProps fp alt) = do +shapeToElements layout (Pic picProps fp titleText alt) = do mInfo <- registerMedia fp alt case mInfoExt mInfo of Just _ -> map Elem <$> - makePicElements layout picProps mInfo alt + makePicElements layout picProps mInfo titleText alt Nothing -> shapeToElements layout $ TextBox [Paragraph def alt] shapeToElements layout (GraphicFrame tbls cptn) = map Elem <$> graphicFrameToElements layout tbls cptn diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 9246a93e9..0400783e3 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -197,7 +197,8 @@ data Layout = MetadataSlide [ParaElem] [ParaElem] [[ParaElem]] [ParaElem] -- heading left right deriving (Show, Eq) -data Shape = Pic PicProps FilePath [ParaElem] +data Shape = Pic PicProps FilePath T.Text [ParaElem] + -- title alt-text | GraphicFrame [Graphic] [ParaElem] | TextBox [Paragraph] | RawOOXMLShape T.Text @@ -525,21 +526,22 @@ rowToParagraphs algns tblCells = do mapM (uncurry cellToParagraphs) pairs withAttr :: Attr -> Shape -> Shape -withAttr attr (Pic picPr url caption) = +withAttr attr (Pic picPr url title caption) = let picPr' = picPr { picWidth = dimension Width attr , picHeight = dimension Height attr } in - Pic picPr' url caption + Pic picPr' url title caption withAttr _ sp = sp blockToShape :: Block -> Pres Shape blockToShape (Plain ils) = blockToShape (Para ils) -blockToShape (Para (il:_)) | Image attr ils (url, _) <- il = - withAttr attr . Pic def (T.unpack url) <$> inlinesToParElems ils +blockToShape (Para (il:_)) | Image attr ils (url, title) <- il = + withAttr attr . Pic def (T.unpack url) title <$> inlinesToParElems ils blockToShape (Para (il:_)) | Link _ (il':_) target <- il - , Image attr ils (url, _) <- il' = - withAttr attr . Pic def{picPropLink = Just $ ExternalTarget target} (T.unpack url) + , Image attr ils (url, title) <- il' = + withAttr attr . + Pic def{picPropLink = Just $ ExternalTarget target} (T.unpack url) title <$> inlinesToParElems ils blockToShape (Table _ blkCapt specs thead tbody tfoot) = do let (caption, algn, _, hdrCells, rows) = toLegacyTable blkCapt specs thead tbody tfoot @@ -805,7 +807,7 @@ applyToParagraph f para = do return $ para {paraElems = paraElems'} applyToShape :: Monad m => (ParaElem -> m ParaElem) -> Shape -> m Shape -applyToShape f (Pic pPr fp pes) = Pic pPr fp <$> mapM f pes +applyToShape f (Pic pPr fp title pes) = Pic pPr fp title <$> mapM f pes applyToShape f (GraphicFrame gfx pes) = GraphicFrame gfx <$> mapM f pes applyToShape f (TextBox paras) = TextBox <$> mapM (applyToParagraph f) paras applyToShape _ (RawOOXMLShape str) = return $ RawOOXMLShape str diff --git a/test/pptx/images.pptx b/test/pptx/images.pptx index 670a825de..89325e577 100644 Binary files a/test/pptx/images.pptx and b/test/pptx/images.pptx differ diff --git a/test/pptx/images_deleted_layouts.pptx b/test/pptx/images_deleted_layouts.pptx index 7a38ea625..053928863 100644 Binary files a/test/pptx/images_deleted_layouts.pptx and b/test/pptx/images_deleted_layouts.pptx differ diff --git a/test/pptx/images_moved_layouts.pptx b/test/pptx/images_moved_layouts.pptx index 08d1c27e0..7951a09f6 100644 Binary files a/test/pptx/images_moved_layouts.pptx and b/test/pptx/images_moved_layouts.pptx differ diff --git a/test/pptx/images_templated.pptx b/test/pptx/images_templated.pptx index 48ebf66d6..7c0ed9a17 100644 Binary files a/test/pptx/images_templated.pptx and b/test/pptx/images_templated.pptx differ diff --git a/test/pptx/speaker_notes_afterseps.pptx b/test/pptx/speaker_notes_afterseps.pptx index 13f564bf0..9542fe8b5 100644 Binary files a/test/pptx/speaker_notes_afterseps.pptx and b/test/pptx/speaker_notes_afterseps.pptx differ diff --git a/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx b/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx index 1e7f4968d..9fec1c279 100644 Binary files a/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx and b/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterseps_moved_layouts.pptx b/test/pptx/speaker_notes_afterseps_moved_layouts.pptx index e092ae444..de697cbd8 100644 Binary files a/test/pptx/speaker_notes_afterseps_moved_layouts.pptx and b/test/pptx/speaker_notes_afterseps_moved_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterseps_templated.pptx b/test/pptx/speaker_notes_afterseps_templated.pptx index 9c22eaf38..5a3d15d57 100644 Binary files a/test/pptx/speaker_notes_afterseps_templated.pptx and b/test/pptx/speaker_notes_afterseps_templated.pptx differ -- cgit v1.2.3 From 8e5a79f264dd1ebe80e048397b6281e318d25e82 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Fri, 20 Aug 2021 14:40:09 +0100 Subject: pptx: Make first heading title if slide level is 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 53 +++++++++++---------- test/Tests/Writers/Powerpoint.hs | 25 ++++++++++ test/pptx/slide-level-0-h1-h2-with-table.native | 14 ++++++ test/pptx/slide-level-0-h1-h2-with-table.pptx | Bin 0 -> 26985 bytes ...e-level-0-h1-h2-with-table_deleted_layouts.pptx | Bin 0 -> 29828 bytes ...ide-level-0-h1-h2-with-table_moved_layouts.pptx | Bin 0 -> 40552 bytes .../slide-level-0-h1-h2-with-table_templated.pptx | Bin 0 -> 40052 bytes test/pptx/slide-level-0-h1-with-image.native | 2 + test/pptx/slide-level-0-h1-with-image.pptx | Bin 0 -> 42596 bytes ...lide-level-0-h1-with-image_deleted_layouts.pptx | Bin 0 -> 45433 bytes .../slide-level-0-h1-with-image_moved_layouts.pptx | Bin 0 -> 56156 bytes .../slide-level-0-h1-with-image_templated.pptx | Bin 0 -> 55657 bytes test/pptx/slide-level-0-h1-with-table.native | 13 +++++ test/pptx/slide-level-0-h1-with-table.pptx | Bin 0 -> 26166 bytes ...lide-level-0-h1-with-table_deleted_layouts.pptx | Bin 0 -> 29008 bytes .../slide-level-0-h1-with-table_moved_layouts.pptx | Bin 0 -> 39731 bytes .../slide-level-0-h1-with-table_templated.pptx | Bin 0 -> 39232 bytes test/pptx/slide-level-0-h2-with-image.native | 2 + test/pptx/slide-level-0-h2-with-image.pptx | Bin 0 -> 42596 bytes ...lide-level-0-h2-with-image_deleted_layouts.pptx | Bin 0 -> 45433 bytes .../slide-level-0-h2-with-image_moved_layouts.pptx | Bin 0 -> 56156 bytes .../slide-level-0-h2-with-image_templated.pptx | Bin 0 -> 55657 bytes 22 files changed, 85 insertions(+), 24 deletions(-) create mode 100644 test/pptx/slide-level-0-h1-h2-with-table.native create mode 100644 test/pptx/slide-level-0-h1-h2-with-table.pptx create mode 100644 test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-h2-with-table_templated.pptx create mode 100644 test/pptx/slide-level-0-h1-with-image.native create mode 100644 test/pptx/slide-level-0-h1-with-image.pptx create mode 100644 test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-with-image_templated.pptx create mode 100644 test/pptx/slide-level-0-h1-with-table.native create mode 100644 test/pptx/slide-level-0-h1-with-table.pptx create mode 100644 test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-with-table_templated.pptx create mode 100644 test/pptx/slide-level-0-h2-with-image.native create mode 100644 test/pptx/slide-level-0-h2-with-image.pptx create mode 100644 test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx create mode 100644 test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx create mode 100644 test/pptx/slide-level-0-h2-with-image_templated.pptx (limited to 'test/pptx') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 0400783e3..284b9ae62 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -604,7 +604,7 @@ splitBlocks' cur acc (Para (il:ils) : blks) | isImage il = do then span isNotesDiv blks else ([], blks) case cur of - [Header n _ _] | n == slideLevel -> + [Header n _ _] | n == slideLevel || slideLevel == 0 -> splitBlocks' [] (acc ++ [cur ++ [Para [il]] ++ nts]) (if null ils then blks' else Para ils : blks') @@ -615,14 +615,14 @@ splitBlocks' cur acc (tbl@Table{} : blks) = do slideLevel <- asks envSlideLevel let (nts, blks') = span isNotesDiv blks case cur of - [Header n _ _] | n == slideLevel -> + [Header n _ _] | n == slideLevel || slideLevel == 0 -> splitBlocks' [] (acc ++ [cur ++ [tbl] ++ nts]) blks' _ -> splitBlocks' [] (acc ++ ([cur | not (null cur)]) ++ [tbl : nts]) blks' splitBlocks' cur acc (d@(Div (_, classes, _) _): blks) | "columns" `elem` classes = do slideLevel <- asks envSlideLevel let (nts, blks') = span isNotesDiv blks case cur of - [Header n _ _] | n == slideLevel -> + [Header n _ _] | n == slideLevel || slideLevel == 0 -> splitBlocks' [] (acc ++ [cur ++ [d] ++ nts]) blks' _ -> splitBlocks' [] (acc ++ ([cur | not (null cur)]) ++ [d : nts]) blks' splitBlocks' cur acc (blk : blks) = splitBlocks' (cur ++ [blk]) acc blks @@ -630,25 +630,10 @@ splitBlocks' cur acc (blk : blks) = splitBlocks' (cur ++ [blk]) acc blks splitBlocks :: [Block] -> Pres [[Block]] splitBlocks = splitBlocks' [] [] -blocksToSlide' :: Int -> [Block] -> SpeakerNotes -> Pres Slide -blocksToSlide' lvl (Header n (ident, _, _) ils : blks) spkNotes - | n < lvl = do - registerAnchorId ident - sldId <- asks envCurSlideId - hdr <- inlinesToParElems ils - return $ Slide sldId (TitleSlide hdr) spkNotes - | n == lvl = do - registerAnchorId ident - hdr <- inlinesToParElems ils - -- Now get the slide without the header, and then add the header - -- in. - slide <- blocksToSlide' lvl blks spkNotes - let layout = case slideLayout slide of - ContentSlide _ cont -> ContentSlide hdr cont - TwoColumnSlide _ contL contR -> TwoColumnSlide hdr contL contR - layout' -> layout' - return $ slide{slideLayout = layout} -blocksToSlide' _ (blk : blks) spkNotes +-- | Assuming the slide title is already handled, convert these blocks to the +-- body content for the slide. +bodyBlocksToSlide :: Int -> [Block] -> SpeakerNotes -> Pres Slide +bodyBlocksToSlide _ (blk : blks) spkNotes | Div (_, classes, _) divBlks <- blk , "columns" `elem` classes , Div (_, clsL, _) blksL : Div (_, clsR, _) blksR : remaining <- divBlks @@ -669,7 +654,7 @@ blocksToSlide' _ (blk : blks) spkNotes sldId (TwoColumnSlide [] shapesL shapesR) spkNotes -blocksToSlide' _ (blk : blks) spkNotes = do +bodyBlocksToSlide _ (blk : blks) spkNotes = do inNoteSlide <- asks envInNoteSlide shapes <- if inNoteSlide then forceFontSize noteSize $ blocksToShapes (blk : blks) @@ -680,7 +665,7 @@ blocksToSlide' _ (blk : blks) spkNotes = do sldId (ContentSlide [] shapes) spkNotes -blocksToSlide' _ [] spkNotes = do +bodyBlocksToSlide _ [] spkNotes = do sldId <- asks envCurSlideId return $ Slide @@ -688,6 +673,26 @@ blocksToSlide' _ [] spkNotes = do (ContentSlide [] []) spkNotes +blocksToSlide' :: Int -> [Block] -> SpeakerNotes -> Pres Slide +blocksToSlide' lvl (Header n (ident, _, _) ils : blks) spkNotes + | n < lvl = do + registerAnchorId ident + sldId <- asks envCurSlideId + hdr <- inlinesToParElems ils + return $ Slide sldId (TitleSlide hdr) spkNotes + | n == lvl || lvl == 0 = do + registerAnchorId ident + hdr <- inlinesToParElems ils + -- Now get the slide without the header, and then add the header + -- in. + slide <- bodyBlocksToSlide lvl blks spkNotes + let layout = case slideLayout slide of + ContentSlide _ cont -> ContentSlide hdr cont + TwoColumnSlide _ contL contR -> TwoColumnSlide hdr contL contR + layout' -> layout' + return $ slide{slideLayout = layout} +blocksToSlide' lvl blks spkNotes = bodyBlocksToSlide lvl blks spkNotes + blockToSpeakerNotes :: Block -> Pres SpeakerNotes blockToSpeakerNotes (Div (_, ["notes"], _) blks) = local (\env -> env{envInSpeakerNotes=True}) $ 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" ] diff --git a/test/pptx/slide-level-0-h1-h2-with-table.native b/test/pptx/slide-level-0-h1-h2-with-table.native new file mode 100644 index 000000000..c6e65ecf5 --- /dev/null +++ b/test/pptx/slide-level-0-h1-h2-with-table.native @@ -0,0 +1,14 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Header 2 ("there",[],[]) [Str "There"] +,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + [])] diff --git a/test/pptx/slide-level-0-h1-h2-with-table.pptx b/test/pptx/slide-level-0-h1-h2-with-table.pptx new file mode 100644 index 000000000..197a6833f Binary files /dev/null and b/test/pptx/slide-level-0-h1-h2-with-table.pptx differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx new file mode 100644 index 000000000..5e776e05c Binary files /dev/null and b/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx b/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx new file mode 100644 index 000000000..35204de1b Binary files /dev/null and b/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx b/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx new file mode 100644 index 000000000..5c659952e Binary files /dev/null and b/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-image.native b/test/pptx/slide-level-0-h1-with-image.native new file mode 100644 index 000000000..0f5033b54 --- /dev/null +++ b/test/pptx/slide-level-0-h1-with-image.native @@ -0,0 +1,2 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0-h1-with-image.pptx b/test/pptx/slide-level-0-h1-with-image.pptx new file mode 100644 index 000000000..2f3a53f5c Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-image.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx new file mode 100644 index 000000000..16c61d1be Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx b/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx new file mode 100644 index 000000000..395036069 Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-image_templated.pptx b/test/pptx/slide-level-0-h1-with-image_templated.pptx new file mode 100644 index 000000000..d306375e9 Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-image_templated.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-table.native b/test/pptx/slide-level-0-h1-with-table.native new file mode 100644 index 000000000..b961e900d --- /dev/null +++ b/test/pptx/slide-level-0-h1-with-table.native @@ -0,0 +1,13 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + [])] diff --git a/test/pptx/slide-level-0-h1-with-table.pptx b/test/pptx/slide-level-0-h1-with-table.pptx new file mode 100644 index 000000000..44dbbf90c Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-table.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx new file mode 100644 index 000000000..0eb7c0b08 Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx b/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx new file mode 100644 index 000000000..197499bc3 Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-table_templated.pptx b/test/pptx/slide-level-0-h1-with-table_templated.pptx new file mode 100644 index 000000000..87b45dda2 Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-table_templated.pptx differ diff --git a/test/pptx/slide-level-0-h2-with-image.native b/test/pptx/slide-level-0-h2-with-image.native new file mode 100644 index 000000000..5def0cb92 --- /dev/null +++ b/test/pptx/slide-level-0-h2-with-image.native @@ -0,0 +1,2 @@ +[Header 2 ("hello",[],[]) [Str "Hello"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0-h2-with-image.pptx b/test/pptx/slide-level-0-h2-with-image.pptx new file mode 100644 index 000000000..948659d6a Binary files /dev/null and b/test/pptx/slide-level-0-h2-with-image.pptx differ diff --git a/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx b/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx new file mode 100644 index 000000000..afc096ce6 Binary files /dev/null and b/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx b/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx new file mode 100644 index 000000000..395036069 Binary files /dev/null and b/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h2-with-image_templated.pptx b/test/pptx/slide-level-0-h2-with-image_templated.pptx new file mode 100644 index 000000000..d306375e9 Binary files /dev/null and b/test/pptx/slide-level-0-h2-with-image_templated.pptx differ -- cgit v1.2.3 From 8dbea4909211ef7b2acc677288be7c5f10cbb40e Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Wed, 25 Aug 2021 14:35:19 +0100 Subject: pptx: Restructure tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use dashes consistently rather than underscores - Make a folder for each set of tests - List test files explicitly (Cabal doesn’t support ** until version 2.4) --- pandoc.cabal | 55 +++++++++- test/Tests/Writers/Powerpoint.hs | 114 ++++++++++----------- test/pptx/code-custom.pptx | Bin 28184 -> 0 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 0 -> 31033 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 0 -> 41822 bytes test/pptx/code-custom/output.pptx | Bin 0 -> 28184 bytes test/pptx/code-custom/templated.pptx | Bin 0 -> 41337 bytes test/pptx/code-custom_deleted_layouts.pptx | Bin 31033 -> 0 bytes test/pptx/code-custom_moved_layouts.pptx | Bin 41822 -> 0 bytes test/pptx/code-custom_templated.pptx | Bin 41337 -> 0 bytes test/pptx/code.native | 21 ---- test/pptx/code.pptx | Bin 28183 -> 0 bytes test/pptx/code/deleted-layouts.pptx | Bin 0 -> 31032 bytes test/pptx/code/input.native | 21 ++++ test/pptx/code/moved-layouts.pptx | Bin 0 -> 41826 bytes test/pptx/code/output.pptx | Bin 0 -> 28183 bytes test/pptx/code/templated.pptx | Bin 0 -> 41337 bytes test/pptx/code_deleted_layouts.pptx | Bin 31032 -> 0 bytes test/pptx/code_moved_layouts.pptx | Bin 41826 -> 0 bytes test/pptx/code_templated.pptx | Bin 41337 -> 0 bytes test/pptx/document-properties-short-desc.native | 2 - test/pptx/document-properties-short-desc.pptx | Bin 26967 -> 0 bytes .../deleted-layouts.pptx | Bin 0 -> 29806 bytes .../document-properties-short-desc/input.native | 2 + .../moved-layouts.pptx | Bin 0 -> 40600 bytes .../document-properties-short-desc/output.pptx | Bin 0 -> 26967 bytes .../document-properties-short-desc/templated.pptx | Bin 0 -> 40113 bytes ...ment-properties-short-desc_deleted_layouts.pptx | Bin 29806 -> 0 bytes ...cument-properties-short-desc_moved_layouts.pptx | Bin 40600 -> 0 bytes .../document-properties-short-desc_templated.pptx | Bin 40113 -> 0 bytes test/pptx/document-properties.native | 2 - test/pptx/document-properties.pptx | Bin 27375 -> 0 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 0 -> 30210 bytes test/pptx/document-properties/input.native | 2 + test/pptx/document-properties/moved-layouts.pptx | Bin 0 -> 41004 bytes test/pptx/document-properties/output.pptx | Bin 0 -> 27375 bytes test/pptx/document-properties/templated.pptx | Bin 0 -> 40517 bytes test/pptx/document-properties_deleted_layouts.pptx | Bin 30210 -> 0 bytes test/pptx/document-properties_moved_layouts.pptx | Bin 41004 -> 0 bytes test/pptx/document-properties_templated.pptx | Bin 40517 -> 0 bytes test/pptx/endnotes-toc/deleted-layouts.pptx | Bin 0 -> 30596 bytes test/pptx/endnotes-toc/moved-layouts.pptx | Bin 0 -> 41384 bytes test/pptx/endnotes-toc/output.pptx | Bin 0 -> 27747 bytes test/pptx/endnotes-toc/templated.pptx | Bin 0 -> 40899 bytes test/pptx/endnotes.native | 2 - test/pptx/endnotes.pptx | Bin 26928 -> 0 bytes test/pptx/endnotes/deleted-layouts.pptx | Bin 0 -> 29774 bytes test/pptx/endnotes/input.native | 2 + test/pptx/endnotes/moved-layouts.pptx | Bin 0 -> 40566 bytes test/pptx/endnotes/output.pptx | Bin 0 -> 26928 bytes test/pptx/endnotes/templated.pptx | Bin 0 -> 40078 bytes test/pptx/endnotes_deleted_layouts.pptx | Bin 29774 -> 0 bytes test/pptx/endnotes_moved_layouts.pptx | Bin 40566 -> 0 bytes test/pptx/endnotes_templated.pptx | Bin 40078 -> 0 bytes test/pptx/endnotes_toc.pptx | Bin 27747 -> 0 bytes test/pptx/endnotes_toc_deleted_layouts.pptx | Bin 30596 -> 0 bytes test/pptx/endnotes_toc_moved_layouts.pptx | Bin 41384 -> 0 bytes test/pptx/endnotes_toc_templated.pptx | Bin 40899 -> 0 bytes test/pptx/images.native | 5 - test/pptx/images.pptx | Bin 44596 -> 0 bytes test/pptx/images/deleted-layouts.pptx | Bin 0 -> 47437 bytes test/pptx/images/input.native | 5 + test/pptx/images/moved-layouts.pptx | Bin 0 -> 58160 bytes test/pptx/images/output.pptx | Bin 0 -> 44596 bytes test/pptx/images/templated.pptx | Bin 0 -> 57660 bytes test/pptx/images_deleted_layouts.pptx | Bin 47437 -> 0 bytes test/pptx/images_moved_layouts.pptx | Bin 58160 -> 0 bytes test/pptx/images_templated.pptx | Bin 57660 -> 0 bytes test/pptx/inline-formatting/deleted-layouts.pptx | Bin 0 -> 28966 bytes test/pptx/inline-formatting/input.native | 5 + test/pptx/inline-formatting/moved-layouts.pptx | Bin 0 -> 39758 bytes test/pptx/inline-formatting/output.pptx | Bin 0 -> 26121 bytes test/pptx/inline-formatting/templated.pptx | Bin 0 -> 39272 bytes test/pptx/inline_formatting.native | 5 - test/pptx/inline_formatting.pptx | Bin 26121 -> 0 bytes test/pptx/inline_formatting_deleted_layouts.pptx | Bin 28966 -> 0 bytes test/pptx/inline_formatting_moved_layouts.pptx | Bin 39758 -> 0 bytes test/pptx/inline_formatting_templated.pptx | Bin 39272 -> 0 bytes test/pptx/lists.native | 18 ---- test/pptx/lists.pptx | Bin 27015 -> 0 bytes test/pptx/lists/deleted-layouts.pptx | Bin 0 -> 29861 bytes test/pptx/lists/input.native | 18 ++++ test/pptx/lists/moved-layouts.pptx | Bin 0 -> 40653 bytes test/pptx/lists/output.pptx | Bin 0 -> 27015 bytes test/pptx/lists/templated.pptx | Bin 0 -> 40166 bytes test/pptx/lists_deleted_layouts.pptx | Bin 29861 -> 0 bytes test/pptx/lists_moved_layouts.pptx | Bin 40653 -> 0 bytes test/pptx/lists_templated.pptx | Bin 40166 -> 0 bytes test/pptx/raw-ooxml/deleted-layouts.pptx | Bin 0 -> 29754 bytes test/pptx/raw-ooxml/input.native | 3 + test/pptx/raw-ooxml/moved-layouts.pptx | Bin 0 -> 40546 bytes test/pptx/raw-ooxml/output.pptx | Bin 0 -> 26908 bytes test/pptx/raw-ooxml/templated.pptx | Bin 0 -> 40059 bytes test/pptx/raw_ooxml.native | 3 - test/pptx/raw_ooxml.pptx | Bin 26908 -> 0 bytes test/pptx/raw_ooxml_deleted_layouts.pptx | Bin 29754 -> 0 bytes test/pptx/raw_ooxml_moved_layouts.pptx | Bin 40546 -> 0 bytes test/pptx/raw_ooxml_templated.pptx | Bin 40059 -> 0 bytes test/pptx/reference-deleted-layouts.pptx | Bin 0 -> 18160 bytes test/pptx/reference-depth.pptx | Bin 0 -> 43743 bytes test/pptx/reference-moved-layouts.pptx | Bin 0 -> 44237 bytes test/pptx/reference_deleted_layouts.pptx | Bin 18160 -> 0 bytes test/pptx/reference_depth.pptx | Bin 43743 -> 0 bytes test/pptx/reference_moved_layouts.pptx | Bin 44237 -> 0 bytes test/pptx/remove-empty-slides/deleted-layouts.pptx | Bin 0 -> 46867 bytes test/pptx/remove-empty-slides/input.native | 5 + test/pptx/remove-empty-slides/moved-layouts.pptx | Bin 0 -> 57656 bytes test/pptx/remove-empty-slides/output.pptx | Bin 0 -> 44025 bytes test/pptx/remove-empty-slides/templated.pptx | Bin 0 -> 57172 bytes test/pptx/remove_empty_slides.native | 5 - test/pptx/remove_empty_slides.pptx | Bin 44025 -> 0 bytes test/pptx/remove_empty_slides_deleted_layouts.pptx | Bin 46867 -> 0 bytes test/pptx/remove_empty_slides_moved_layouts.pptx | Bin 57656 -> 0 bytes test/pptx/remove_empty_slides_templated.pptx | Bin 57172 -> 0 bytes .../deleted-layouts.pptx | Bin 0 -> 30554 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 0 -> 41343 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 0 -> 27705 bytes .../pptx/slide-breaks-slide-level-1/templated.pptx | Bin 0 -> 40858 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 0 -> 32328 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 0 -> 43118 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 0 -> 29481 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 0 -> 42634 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 0 -> 31378 bytes test/pptx/slide-breaks/input.native | 7 ++ test/pptx/slide-breaks/moved-layouts.pptx | Bin 0 -> 42171 bytes test/pptx/slide-breaks/output.pptx | Bin 0 -> 28531 bytes test/pptx/slide-breaks/templated.pptx | Bin 0 -> 41683 bytes test/pptx/slide-level-0-h1-h2-with-table.native | 14 --- test/pptx/slide-level-0-h1-h2-with-table.pptx | Bin 26985 -> 0 bytes ...e-level-0-h1-h2-with-table_deleted_layouts.pptx | Bin 29828 -> 0 bytes ...ide-level-0-h1-h2-with-table_moved_layouts.pptx | Bin 40552 -> 0 bytes .../slide-level-0-h1-h2-with-table_templated.pptx | Bin 40052 -> 0 bytes test/pptx/slide-level-0-h1-with-image.native | 2 - test/pptx/slide-level-0-h1-with-image.pptx | Bin 42596 -> 0 bytes ...lide-level-0-h1-with-image_deleted_layouts.pptx | Bin 45433 -> 0 bytes .../slide-level-0-h1-with-image_moved_layouts.pptx | Bin 56156 -> 0 bytes .../slide-level-0-h1-with-image_templated.pptx | Bin 55657 -> 0 bytes test/pptx/slide-level-0-h1-with-table.native | 13 --- test/pptx/slide-level-0-h1-with-table.pptx | Bin 26166 -> 0 bytes ...lide-level-0-h1-with-table_deleted_layouts.pptx | Bin 29008 -> 0 bytes .../slide-level-0-h1-with-table_moved_layouts.pptx | Bin 39731 -> 0 bytes .../slide-level-0-h1-with-table_templated.pptx | Bin 39232 -> 0 bytes test/pptx/slide-level-0-h2-with-image.native | 2 - test/pptx/slide-level-0-h2-with-image.pptx | Bin 42596 -> 0 bytes ...lide-level-0-h2-with-image_deleted_layouts.pptx | Bin 45433 -> 0 bytes .../slide-level-0-h2-with-image_moved_layouts.pptx | Bin 56156 -> 0 bytes .../slide-level-0-h2-with-image_templated.pptx | Bin 55657 -> 0 bytes .../h1-h2-with-table/deleted-layouts.pptx | Bin 0 -> 29828 bytes .../slide-level-0/h1-h2-with-table/input.native | 14 +++ .../h1-h2-with-table/moved-layouts.pptx | Bin 0 -> 40552 bytes .../slide-level-0/h1-h2-with-table/output.pptx | Bin 0 -> 26985 bytes .../slide-level-0/h1-h2-with-table/templated.pptx | Bin 0 -> 40052 bytes .../h1-with-image/deleted-layouts.pptx | Bin 0 -> 45433 bytes test/pptx/slide-level-0/h1-with-image/input.native | 2 + .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 0 -> 56156 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 0 -> 42596 bytes .../slide-level-0/h1-with-image/templated.pptx | Bin 0 -> 55657 bytes .../h1-with-table/deleted-layouts.pptx | Bin 0 -> 29008 bytes test/pptx/slide-level-0/h1-with-table/input.native | 13 +++ .../slide-level-0/h1-with-table/moved-layouts.pptx | Bin 0 -> 39731 bytes test/pptx/slide-level-0/h1-with-table/output.pptx | Bin 0 -> 26166 bytes .../slide-level-0/h1-with-table/templated.pptx | Bin 0 -> 39232 bytes .../h2-with-image/deleted-layouts.pptx | Bin 0 -> 45433 bytes test/pptx/slide-level-0/h2-with-image/input.native | 2 + .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 0 -> 56156 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 0 -> 42596 bytes .../slide-level-0/h2-with-image/templated.pptx | Bin 0 -> 55657 bytes test/pptx/slide_breaks.native | 7 -- test/pptx/slide_breaks.pptx | Bin 28531 -> 0 bytes test/pptx/slide_breaks_deleted_layouts.pptx | Bin 31378 -> 0 bytes test/pptx/slide_breaks_moved_layouts.pptx | Bin 42171 -> 0 bytes test/pptx/slide_breaks_slide_level_1.pptx | Bin 27705 -> 0 bytes ...slide_breaks_slide_level_1_deleted_layouts.pptx | Bin 30554 -> 0 bytes .../slide_breaks_slide_level_1_moved_layouts.pptx | Bin 41343 -> 0 bytes .../pptx/slide_breaks_slide_level_1_templated.pptx | Bin 40858 -> 0 bytes test/pptx/slide_breaks_templated.pptx | Bin 41683 -> 0 bytes test/pptx/slide_breaks_toc.pptx | Bin 29481 -> 0 bytes test/pptx/slide_breaks_toc_deleted_layouts.pptx | Bin 32328 -> 0 bytes test/pptx/slide_breaks_toc_moved_layouts.pptx | Bin 43118 -> 0 bytes test/pptx/slide_breaks_toc_templated.pptx | Bin 42634 -> 0 bytes .../deleted-layouts.pptx | Bin 0 -> 34473 bytes .../pptx/speaker-notes-after-metadata/input.native | 5 + .../moved-layouts.pptx | Bin 0 -> 45269 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 0 -> 31636 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 0 -> 44775 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 0 -> 33500 bytes test/pptx/speaker-notes-afterheader/input.native | 3 + .../speaker-notes-afterheader/moved-layouts.pptx | Bin 0 -> 44297 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 0 -> 30657 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 0 -> 43803 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 0 -> 54396 bytes test/pptx/speaker-notes-afterseps/input.native | 63 ++++++++++++ .../speaker-notes-afterseps/moved-layouts.pptx | Bin 0 -> 65121 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 0 -> 51557 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 0 -> 64619 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 0 -> 38203 bytes test/pptx/speaker-notes/input.native | 17 +++ test/pptx/speaker-notes/moved-layouts.pptx | Bin 0 -> 49002 bytes test/pptx/speaker-notes/output.pptx | Bin 0 -> 35360 bytes test/pptx/speaker-notes/templated.pptx | Bin 0 -> 48507 bytes test/pptx/speaker_notes.native | 17 --- test/pptx/speaker_notes.pptx | Bin 35360 -> 0 bytes test/pptx/speaker_notes_after_metadata.native | 5 - test/pptx/speaker_notes_after_metadata.pptx | Bin 31636 -> 0 bytes ...eaker_notes_after_metadata_deleted_layouts.pptx | Bin 34473 -> 0 bytes ...speaker_notes_after_metadata_moved_layouts.pptx | Bin 45269 -> 0 bytes .../speaker_notes_after_metadata_templated.pptx | Bin 44775 -> 0 bytes test/pptx/speaker_notes_afterheader.native | 3 - test/pptx/speaker_notes_afterheader.pptx | Bin 30657 -> 0 bytes .../speaker_notes_afterheader_deleted_layouts.pptx | Bin 33500 -> 0 bytes .../speaker_notes_afterheader_moved_layouts.pptx | Bin 44297 -> 0 bytes test/pptx/speaker_notes_afterheader_templated.pptx | Bin 43803 -> 0 bytes test/pptx/speaker_notes_afterseps.native | 63 ------------ test/pptx/speaker_notes_afterseps.pptx | Bin 51557 -> 0 bytes .../speaker_notes_afterseps_deleted_layouts.pptx | Bin 54396 -> 0 bytes .../speaker_notes_afterseps_moved_layouts.pptx | Bin 65121 -> 0 bytes test/pptx/speaker_notes_afterseps_templated.pptx | Bin 64619 -> 0 bytes test/pptx/speaker_notes_deleted_layouts.pptx | Bin 38203 -> 0 bytes test/pptx/speaker_notes_moved_layouts.pptx | Bin 49002 -> 0 bytes test/pptx/speaker_notes_templated.pptx | Bin 48507 -> 0 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 0 -> 29837 bytes test/pptx/start-numbering-at/input.native | 9 ++ test/pptx/start-numbering-at/moved-layouts.pptx | Bin 0 -> 40630 bytes test/pptx/start-numbering-at/output.pptx | Bin 0 -> 26991 bytes test/pptx/start-numbering-at/templated.pptx | Bin 0 -> 40142 bytes test/pptx/start_numbering_at.native | 9 -- test/pptx/start_numbering_at.pptx | Bin 26991 -> 0 bytes test/pptx/start_numbering_at_deleted_layouts.pptx | Bin 29837 -> 0 bytes test/pptx/start_numbering_at_moved_layouts.pptx | Bin 40630 -> 0 bytes test/pptx/start_numbering_at_templated.pptx | Bin 40142 -> 0 bytes test/pptx/tables.native | 95 ----------------- test/pptx/tables.pptx | Bin 27532 -> 0 bytes test/pptx/tables/deleted-layouts.pptx | Bin 0 -> 30381 bytes test/pptx/tables/input.native | 95 +++++++++++++++++ test/pptx/tables/moved-layouts.pptx | Bin 0 -> 41174 bytes test/pptx/tables/output.pptx | Bin 0 -> 27532 bytes test/pptx/tables/templated.pptx | Bin 0 -> 40686 bytes test/pptx/tables_deleted_layouts.pptx | Bin 30381 -> 0 bytes test/pptx/tables_moved_layouts.pptx | Bin 41174 -> 0 bytes test/pptx/tables_templated.pptx | Bin 40686 -> 0 bytes test/pptx/two-column/deleted-layouts.pptx | Bin 0 -> 28883 bytes test/pptx/two-column/input.native | 9 ++ test/pptx/two-column/moved-layouts.pptx | Bin 0 -> 39676 bytes test/pptx/two-column/output.pptx | Bin 0 -> 26038 bytes test/pptx/two-column/templated.pptx | Bin 0 -> 39189 bytes test/pptx/two_column.native | 9 -- test/pptx/two_column.pptx | Bin 26038 -> 0 bytes test/pptx/two_column_deleted_layouts.pptx | Bin 28883 -> 0 bytes test/pptx/two_column_moved_layouts.pptx | Bin 39676 -> 0 bytes test/pptx/two_column_templated.pptx | Bin 39189 -> 0 bytes 250 files changed, 413 insertions(+), 360 deletions(-) delete mode 100644 test/pptx/code-custom.pptx create mode 100644 test/pptx/code-custom/deleted-layouts.pptx create mode 100644 test/pptx/code-custom/moved-layouts.pptx create mode 100644 test/pptx/code-custom/output.pptx create mode 100644 test/pptx/code-custom/templated.pptx delete mode 100644 test/pptx/code-custom_deleted_layouts.pptx delete mode 100644 test/pptx/code-custom_moved_layouts.pptx delete mode 100644 test/pptx/code-custom_templated.pptx delete mode 100644 test/pptx/code.native delete mode 100644 test/pptx/code.pptx create mode 100644 test/pptx/code/deleted-layouts.pptx create mode 100644 test/pptx/code/input.native create mode 100644 test/pptx/code/moved-layouts.pptx create mode 100644 test/pptx/code/output.pptx create mode 100644 test/pptx/code/templated.pptx delete mode 100644 test/pptx/code_deleted_layouts.pptx delete mode 100644 test/pptx/code_moved_layouts.pptx delete mode 100644 test/pptx/code_templated.pptx delete mode 100644 test/pptx/document-properties-short-desc.native delete mode 100644 test/pptx/document-properties-short-desc.pptx create mode 100644 test/pptx/document-properties-short-desc/deleted-layouts.pptx create mode 100644 test/pptx/document-properties-short-desc/input.native create mode 100644 test/pptx/document-properties-short-desc/moved-layouts.pptx create mode 100644 test/pptx/document-properties-short-desc/output.pptx create mode 100644 test/pptx/document-properties-short-desc/templated.pptx delete mode 100644 test/pptx/document-properties-short-desc_deleted_layouts.pptx delete mode 100644 test/pptx/document-properties-short-desc_moved_layouts.pptx delete mode 100644 test/pptx/document-properties-short-desc_templated.pptx delete mode 100644 test/pptx/document-properties.native delete mode 100644 test/pptx/document-properties.pptx create mode 100644 test/pptx/document-properties/deleted-layouts.pptx create mode 100644 test/pptx/document-properties/input.native create mode 100644 test/pptx/document-properties/moved-layouts.pptx create mode 100644 test/pptx/document-properties/output.pptx create mode 100644 test/pptx/document-properties/templated.pptx delete mode 100644 test/pptx/document-properties_deleted_layouts.pptx delete mode 100644 test/pptx/document-properties_moved_layouts.pptx delete mode 100644 test/pptx/document-properties_templated.pptx create mode 100644 test/pptx/endnotes-toc/deleted-layouts.pptx create mode 100644 test/pptx/endnotes-toc/moved-layouts.pptx create mode 100644 test/pptx/endnotes-toc/output.pptx create mode 100644 test/pptx/endnotes-toc/templated.pptx delete mode 100644 test/pptx/endnotes.native delete mode 100644 test/pptx/endnotes.pptx create mode 100644 test/pptx/endnotes/deleted-layouts.pptx create mode 100644 test/pptx/endnotes/input.native create mode 100644 test/pptx/endnotes/moved-layouts.pptx create mode 100644 test/pptx/endnotes/output.pptx create mode 100644 test/pptx/endnotes/templated.pptx delete mode 100644 test/pptx/endnotes_deleted_layouts.pptx delete mode 100644 test/pptx/endnotes_moved_layouts.pptx delete mode 100644 test/pptx/endnotes_templated.pptx delete mode 100644 test/pptx/endnotes_toc.pptx delete mode 100644 test/pptx/endnotes_toc_deleted_layouts.pptx delete mode 100644 test/pptx/endnotes_toc_moved_layouts.pptx delete mode 100644 test/pptx/endnotes_toc_templated.pptx delete mode 100644 test/pptx/images.native delete mode 100644 test/pptx/images.pptx create mode 100644 test/pptx/images/deleted-layouts.pptx create mode 100644 test/pptx/images/input.native create mode 100644 test/pptx/images/moved-layouts.pptx create mode 100644 test/pptx/images/output.pptx create mode 100644 test/pptx/images/templated.pptx delete mode 100644 test/pptx/images_deleted_layouts.pptx delete mode 100644 test/pptx/images_moved_layouts.pptx delete mode 100644 test/pptx/images_templated.pptx create mode 100644 test/pptx/inline-formatting/deleted-layouts.pptx create mode 100644 test/pptx/inline-formatting/input.native create mode 100644 test/pptx/inline-formatting/moved-layouts.pptx create mode 100644 test/pptx/inline-formatting/output.pptx create mode 100644 test/pptx/inline-formatting/templated.pptx delete mode 100644 test/pptx/inline_formatting.native delete mode 100644 test/pptx/inline_formatting.pptx delete mode 100644 test/pptx/inline_formatting_deleted_layouts.pptx delete mode 100644 test/pptx/inline_formatting_moved_layouts.pptx delete mode 100644 test/pptx/inline_formatting_templated.pptx delete mode 100644 test/pptx/lists.native delete mode 100644 test/pptx/lists.pptx create mode 100644 test/pptx/lists/deleted-layouts.pptx create mode 100644 test/pptx/lists/input.native create mode 100644 test/pptx/lists/moved-layouts.pptx create mode 100644 test/pptx/lists/output.pptx create mode 100644 test/pptx/lists/templated.pptx delete mode 100644 test/pptx/lists_deleted_layouts.pptx delete mode 100644 test/pptx/lists_moved_layouts.pptx delete mode 100644 test/pptx/lists_templated.pptx create mode 100644 test/pptx/raw-ooxml/deleted-layouts.pptx create mode 100644 test/pptx/raw-ooxml/input.native create mode 100644 test/pptx/raw-ooxml/moved-layouts.pptx create mode 100644 test/pptx/raw-ooxml/output.pptx create mode 100644 test/pptx/raw-ooxml/templated.pptx delete mode 100644 test/pptx/raw_ooxml.native delete mode 100644 test/pptx/raw_ooxml.pptx delete mode 100644 test/pptx/raw_ooxml_deleted_layouts.pptx delete mode 100644 test/pptx/raw_ooxml_moved_layouts.pptx delete mode 100644 test/pptx/raw_ooxml_templated.pptx create mode 100644 test/pptx/reference-deleted-layouts.pptx create mode 100644 test/pptx/reference-depth.pptx create mode 100644 test/pptx/reference-moved-layouts.pptx delete mode 100644 test/pptx/reference_deleted_layouts.pptx delete mode 100644 test/pptx/reference_depth.pptx delete mode 100644 test/pptx/reference_moved_layouts.pptx create mode 100644 test/pptx/remove-empty-slides/deleted-layouts.pptx create mode 100644 test/pptx/remove-empty-slides/input.native create mode 100644 test/pptx/remove-empty-slides/moved-layouts.pptx create mode 100644 test/pptx/remove-empty-slides/output.pptx create mode 100644 test/pptx/remove-empty-slides/templated.pptx delete mode 100644 test/pptx/remove_empty_slides.native delete mode 100644 test/pptx/remove_empty_slides.pptx delete mode 100644 test/pptx/remove_empty_slides_deleted_layouts.pptx delete mode 100644 test/pptx/remove_empty_slides_moved_layouts.pptx delete mode 100644 test/pptx/remove_empty_slides_templated.pptx create mode 100644 test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx create mode 100644 test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx create mode 100644 test/pptx/slide-breaks-slide-level-1/output.pptx create mode 100644 test/pptx/slide-breaks-slide-level-1/templated.pptx create mode 100644 test/pptx/slide-breaks-toc/deleted-layouts.pptx create mode 100644 test/pptx/slide-breaks-toc/moved-layouts.pptx create mode 100644 test/pptx/slide-breaks-toc/output.pptx create mode 100644 test/pptx/slide-breaks-toc/templated.pptx create mode 100644 test/pptx/slide-breaks/deleted-layouts.pptx create mode 100644 test/pptx/slide-breaks/input.native create mode 100644 test/pptx/slide-breaks/moved-layouts.pptx create mode 100644 test/pptx/slide-breaks/output.pptx create mode 100644 test/pptx/slide-breaks/templated.pptx delete mode 100644 test/pptx/slide-level-0-h1-h2-with-table.native delete mode 100644 test/pptx/slide-level-0-h1-h2-with-table.pptx delete mode 100644 test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-h2-with-table_templated.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-image.native delete mode 100644 test/pptx/slide-level-0-h1-with-image.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-image_templated.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-table.native delete mode 100644 test/pptx/slide-level-0-h1-with-table.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-table_templated.pptx delete mode 100644 test/pptx/slide-level-0-h2-with-image.native delete mode 100644 test/pptx/slide-level-0-h2-with-image.pptx delete mode 100644 test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h2-with-image_templated.pptx create mode 100644 test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-h2-with-table/input.native create mode 100644 test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-h2-with-table/output.pptx create mode 100644 test/pptx/slide-level-0/h1-h2-with-table/templated.pptx create mode 100644 test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-with-image/input.native create mode 100644 test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-with-image/output.pptx create mode 100644 test/pptx/slide-level-0/h1-with-image/templated.pptx create mode 100644 test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-with-table/input.native create mode 100644 test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-with-table/output.pptx create mode 100644 test/pptx/slide-level-0/h1-with-table/templated.pptx create mode 100644 test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx create mode 100644 test/pptx/slide-level-0/h2-with-image/input.native create mode 100644 test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx create mode 100644 test/pptx/slide-level-0/h2-with-image/output.pptx create mode 100644 test/pptx/slide-level-0/h2-with-image/templated.pptx delete mode 100644 test/pptx/slide_breaks.native delete mode 100644 test/pptx/slide_breaks.pptx delete mode 100644 test/pptx/slide_breaks_deleted_layouts.pptx delete mode 100644 test/pptx/slide_breaks_moved_layouts.pptx delete mode 100644 test/pptx/slide_breaks_slide_level_1.pptx delete mode 100644 test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx delete mode 100644 test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx delete mode 100644 test/pptx/slide_breaks_slide_level_1_templated.pptx delete mode 100644 test/pptx/slide_breaks_templated.pptx delete mode 100644 test/pptx/slide_breaks_toc.pptx delete mode 100644 test/pptx/slide_breaks_toc_deleted_layouts.pptx delete mode 100644 test/pptx/slide_breaks_toc_moved_layouts.pptx delete mode 100644 test/pptx/slide_breaks_toc_templated.pptx create mode 100644 test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx create mode 100644 test/pptx/speaker-notes-after-metadata/input.native create mode 100644 test/pptx/speaker-notes-after-metadata/moved-layouts.pptx create mode 100644 test/pptx/speaker-notes-after-metadata/output.pptx create mode 100644 test/pptx/speaker-notes-after-metadata/templated.pptx create mode 100644 test/pptx/speaker-notes-afterheader/deleted-layouts.pptx create mode 100644 test/pptx/speaker-notes-afterheader/input.native create mode 100644 test/pptx/speaker-notes-afterheader/moved-layouts.pptx create mode 100644 test/pptx/speaker-notes-afterheader/output.pptx create mode 100644 test/pptx/speaker-notes-afterheader/templated.pptx create mode 100644 test/pptx/speaker-notes-afterseps/deleted-layouts.pptx create mode 100644 test/pptx/speaker-notes-afterseps/input.native create mode 100644 test/pptx/speaker-notes-afterseps/moved-layouts.pptx create mode 100644 test/pptx/speaker-notes-afterseps/output.pptx create mode 100644 test/pptx/speaker-notes-afterseps/templated.pptx create mode 100644 test/pptx/speaker-notes/deleted-layouts.pptx create mode 100644 test/pptx/speaker-notes/input.native create mode 100644 test/pptx/speaker-notes/moved-layouts.pptx create mode 100644 test/pptx/speaker-notes/output.pptx create mode 100644 test/pptx/speaker-notes/templated.pptx delete mode 100644 test/pptx/speaker_notes.native delete mode 100644 test/pptx/speaker_notes.pptx delete mode 100644 test/pptx/speaker_notes_after_metadata.native delete mode 100644 test/pptx/speaker_notes_after_metadata.pptx delete mode 100644 test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx delete mode 100644 test/pptx/speaker_notes_after_metadata_moved_layouts.pptx delete mode 100644 test/pptx/speaker_notes_after_metadata_templated.pptx delete mode 100644 test/pptx/speaker_notes_afterheader.native delete mode 100644 test/pptx/speaker_notes_afterheader.pptx delete mode 100644 test/pptx/speaker_notes_afterheader_deleted_layouts.pptx delete mode 100644 test/pptx/speaker_notes_afterheader_moved_layouts.pptx delete mode 100644 test/pptx/speaker_notes_afterheader_templated.pptx delete mode 100644 test/pptx/speaker_notes_afterseps.native delete mode 100644 test/pptx/speaker_notes_afterseps.pptx delete mode 100644 test/pptx/speaker_notes_afterseps_deleted_layouts.pptx delete mode 100644 test/pptx/speaker_notes_afterseps_moved_layouts.pptx delete mode 100644 test/pptx/speaker_notes_afterseps_templated.pptx delete mode 100644 test/pptx/speaker_notes_deleted_layouts.pptx delete mode 100644 test/pptx/speaker_notes_moved_layouts.pptx delete mode 100644 test/pptx/speaker_notes_templated.pptx create mode 100644 test/pptx/start-numbering-at/deleted-layouts.pptx create mode 100644 test/pptx/start-numbering-at/input.native create mode 100644 test/pptx/start-numbering-at/moved-layouts.pptx create mode 100644 test/pptx/start-numbering-at/output.pptx create mode 100644 test/pptx/start-numbering-at/templated.pptx delete mode 100644 test/pptx/start_numbering_at.native delete mode 100644 test/pptx/start_numbering_at.pptx delete mode 100644 test/pptx/start_numbering_at_deleted_layouts.pptx delete mode 100644 test/pptx/start_numbering_at_moved_layouts.pptx delete mode 100644 test/pptx/start_numbering_at_templated.pptx delete mode 100644 test/pptx/tables.native delete mode 100644 test/pptx/tables.pptx create mode 100644 test/pptx/tables/deleted-layouts.pptx create mode 100644 test/pptx/tables/input.native create mode 100644 test/pptx/tables/moved-layouts.pptx create mode 100644 test/pptx/tables/output.pptx create mode 100644 test/pptx/tables/templated.pptx delete mode 100644 test/pptx/tables_deleted_layouts.pptx delete mode 100644 test/pptx/tables_moved_layouts.pptx delete mode 100644 test/pptx/tables_templated.pptx create mode 100644 test/pptx/two-column/deleted-layouts.pptx create mode 100644 test/pptx/two-column/input.native create mode 100644 test/pptx/two-column/moved-layouts.pptx create mode 100644 test/pptx/two-column/output.pptx create mode 100644 test/pptx/two-column/templated.pptx delete mode 100644 test/pptx/two_column.native delete mode 100644 test/pptx/two_column.pptx delete mode 100644 test/pptx/two_column_deleted_layouts.pptx delete mode 100644 test/pptx/two_column_moved_layouts.pptx delete mode 100644 test/pptx/two_column_templated.pptx (limited to 'test/pptx') diff --git a/pandoc.cabal b/pandoc.cabal index da53cb1cd..7fb951488 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -380,7 +380,60 @@ extra-source-files: test/rtf/*.native test/rtf/*.rtf test/pptx/*.pptx - test/pptx/*.native + test/pptx/code-custom/*.pptx + test/pptx/code/input.native + test/pptx/code/*.pptx + test/pptx/comparison-both-columns/input.native + test/pptx/comparison-both-columns/*.pptx + test/pptx/comparison-extra-text/input.native + test/pptx/comparison-extra-text/*.pptx + test/pptx/comparison-non-text-first/input.native + test/pptx/comparison-non-text-first/*.pptx + test/pptx/comparison-one-column/input.native + test/pptx/comparison-one-column/*.pptx + test/pptx/document-properties-short-desc/input.native + test/pptx/document-properties-short-desc/*.pptx + test/pptx/document-properties/input.native + test/pptx/document-properties/*.pptx + test/pptx/endnotes-toc/*.pptx + test/pptx/endnotes/input.native + test/pptx/endnotes/*.pptx + test/pptx/images/input.native + test/pptx/images/*.pptx + test/pptx/inline-formatting/input.native + test/pptx/inline-formatting/*.pptx + test/pptx/lists/input.native + test/pptx/lists/*.pptx + test/pptx/raw-ooxml/input.native + test/pptx/raw-ooxml/*.pptx + test/pptx/remove-empty-slides/input.native + test/pptx/remove-empty-slides/*.pptx + test/pptx/slide-breaks-slide-level-1/*.pptx + test/pptx/slide-breaks-toc/*.pptx + test/pptx/slide-breaks/input.native + test/pptx/slide-breaks/*.pptx + test/pptx/slide-level-0/h1-h2-with-table/input.native + test/pptx/slide-level-0/h1-h2-with-table/*.pptx + test/pptx/slide-level-0/h1-with-image/input.native + test/pptx/slide-level-0/h1-with-image/*.pptx + test/pptx/slide-level-0/h1-with-table/input.native + test/pptx/slide-level-0/h1-with-table/*.pptx + test/pptx/slide-level-0/h2-with-image/input.native + test/pptx/slide-level-0/h2-with-image/*.pptx + test/pptx/speaker-notes-after-metadata/input.native + test/pptx/speaker-notes-after-metadata/*.pptx + test/pptx/speaker-notes-afterheader/input.native + test/pptx/speaker-notes-afterheader/*.pptx + test/pptx/speaker-notes-afterseps/input.native + test/pptx/speaker-notes-afterseps/*.pptx + test/pptx/speaker-notes/input.native + test/pptx/speaker-notes/*.pptx + test/pptx/start-numbering-at/input.native + test/pptx/start-numbering-at/*.pptx + test/pptx/tables/input.native + test/pptx/tables/*.pptx + test/pptx/two-column/input.native + test/pptx/two-column/*.pptx test/ipynb/*.in.native test/ipynb/*.out.native test/ipynb/*.ipynb diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index fd6d01d2d..fd9871659 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -15,13 +15,13 @@ import Data.List (unzip4) modifyPptxName :: FilePath -> String -> FilePath modifyPptxName fp suffix = - addExtension (dropExtension fp ++ suffix) "pptx" + addExtension (takeDirectory fp ++ suffix) "pptx" pptxTests :: String -> WriterOptions -> FilePath -> FilePath -> (TestTree, TestTree, TestTree, TestTree) pptxTests name opts native pptx = - let referenceDoc = "pptx/reference_depth.pptx" - movedLayoutsReferenceDoc = "pptx/reference_moved_layouts.pptx" - deletedLayoutsReferenceDoc = "pptx/reference_deleted_layouts.pptx" + let referenceDoc = "pptx/reference-depth.pptx" + movedLayoutsReferenceDoc = "pptx/reference-moved-layouts.pptx" + deletedLayoutsReferenceDoc = "pptx/reference-deleted-layouts.pptx" in ( ooxmlTest writePowerpoint @@ -34,19 +34,19 @@ pptxTests name opts native pptx = name opts{writerReferenceDoc=Just referenceDoc} native - (modifyPptxName pptx "_templated") + (modifyPptxName pptx "/templated") , ooxmlTest writePowerpoint name opts{writerReferenceDoc=Just movedLayoutsReferenceDoc} native - (modifyPptxName pptx "_moved_layouts") + (modifyPptxName pptx "/moved-layouts") , ooxmlTest writePowerpoint name opts{writerReferenceDoc=Just deletedLayoutsReferenceDoc} native - (modifyPptxName pptx "_deleted_layouts") + (modifyPptxName pptx "/deleted-layouts") ) groupPptxTests :: [(TestTree, TestTree, TestTree, TestTree)] -> [TestTree] @@ -63,112 +63,112 @@ groupPptxTests pairs = tests :: [TestTree] tests = groupPptxTests [ pptxTests "Inline formatting" def - "pptx/inline_formatting.native" - "pptx/inline_formatting.pptx" + "pptx/inline-formatting/input.native" + "pptx/inline-formatting/output.pptx" , pptxTests "Slide breaks (default slide-level)" def - "pptx/slide_breaks.native" - "pptx/slide_breaks.pptx" + "pptx/slide-breaks/input.native" + "pptx/slide-breaks/output.pptx" , pptxTests "slide breaks (slide-level set to 1)" def{ writerSlideLevel = Just 1 } - "pptx/slide_breaks.native" - "pptx/slide_breaks_slide_level_1.pptx" + "pptx/slide-breaks/input.native" + "pptx/slide-breaks-slide-level-1/output.pptx" , pptxTests "lists" def - "pptx/lists.native" - "pptx/lists.pptx" + "pptx/lists/input.native" + "pptx/lists/output.pptx" , pptxTests "start ordered list at specified num" def - "pptx/start_numbering_at.native" - "pptx/start_numbering_at.pptx" + "pptx/start-numbering-at/input.native" + "pptx/start-numbering-at/output.pptx" , pptxTests "tables" def - "pptx/tables.native" - "pptx/tables.pptx" + "pptx/tables/input.native" + "pptx/tables/output.pptx" , pptxTests "table of contents" def{ writerTableOfContents = True } - "pptx/slide_breaks.native" - "pptx/slide_breaks_toc.pptx" + "pptx/slide-breaks/input.native" + "pptx/slide-breaks-toc/output.pptx" , pptxTests "end notes" def - "pptx/endnotes.native" - "pptx/endnotes.pptx" + "pptx/endnotes/input.native" + "pptx/endnotes/output.pptx" , pptxTests "end notes, with table of contents" def { writerTableOfContents = True } - "pptx/endnotes.native" - "pptx/endnotes_toc.pptx" + "pptx/endnotes/input.native" + "pptx/endnotes-toc/output.pptx" , pptxTests "images" def - "pptx/images.native" - "pptx/images.pptx" + "pptx/images/input.native" + "pptx/images/output.pptx" , pptxTests "two-column layout" def - "pptx/two_column.native" - "pptx/two_column.pptx" + "pptx/two-column/input.native" + "pptx/two-column/output.pptx" , pptxTests "speaker notes" def - "pptx/speaker_notes.native" - "pptx/speaker_notes.pptx" + "pptx/speaker-notes/input.native" + "pptx/speaker-notes/output.pptx" , pptxTests "speaker notes after a separating block" def - "pptx/speaker_notes_afterseps.native" - "pptx/speaker_notes_afterseps.pptx" + "pptx/speaker-notes-afterseps/input.native" + "pptx/speaker-notes-afterseps/output.pptx" , pptxTests "speaker notes after a separating header" def - "pptx/speaker_notes_afterheader.native" - "pptx/speaker_notes_afterheader.pptx" + "pptx/speaker-notes-afterheader/input.native" + "pptx/speaker-notes-afterheader/output.pptx" , pptxTests "speaker notes after metadata" def - "pptx/speaker_notes_after_metadata.native" - "pptx/speaker_notes_after_metadata.pptx" + "pptx/speaker-notes-after-metadata/input.native" + "pptx/speaker-notes-after-metadata/output.pptx" , pptxTests "remove empty slides" def - "pptx/remove_empty_slides.native" - "pptx/remove_empty_slides.pptx" + "pptx/remove-empty-slides/input.native" + "pptx/remove-empty-slides/output.pptx" , pptxTests "raw ooxml" def - "pptx/raw_ooxml.native" - "pptx/raw_ooxml.pptx" + "pptx/raw-ooxml/input.native" + "pptx/raw-ooxml/output.pptx" , pptxTests "metadata, custom properties" def - "pptx/document-properties.native" - "pptx/document-properties.pptx" + "pptx/document-properties/input.native" + "pptx/document-properties/output.pptx" , pptxTests "metadata, short description" def - "pptx/document-properties-short-desc.native" - "pptx/document-properties-short-desc.pptx" + "pptx/document-properties-short-desc/input.native" + "pptx/document-properties-short-desc/output.pptx" , pptxTests "inline code and code blocks" def - "pptx/code.native" - "pptx/code.pptx" + "pptx/code/input.native" + "pptx/code/output.pptx" , pptxTests "inline code and code blocks, custom formatting" def { writerVariables = Context $ M.fromList [(pack "monofont", toVal $ pack "Consolas")] } - "pptx/code.native" - "pptx/code-custom.pptx" + "pptx/code/input.native" + "pptx/code-custom/output.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" + "pptx/slide-level-0/h1-with-image/input.native" + "pptx/slide-level-0/h1-with-image/output.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" + "pptx/slide-level-0/h2-with-image/input.native" + "pptx/slide-level-0/h2-with-image/output.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" + "pptx/slide-level-0/h1-with-table/input.native" + "pptx/slide-level-0/h1-with-table/output.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" + "pptx/slide-level-0/h1-h2-with-table/input.native" + "pptx/slide-level-0/h1-h2-with-table/output.pptx" ] diff --git a/test/pptx/code-custom.pptx b/test/pptx/code-custom.pptx deleted file mode 100644 index 5e9c2c630..000000000 Binary files a/test/pptx/code-custom.pptx and /dev/null differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx new file mode 100644 index 000000000..9282e6354 Binary files /dev/null and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx new file mode 100644 index 000000000..a14eeb6c8 Binary files /dev/null and b/test/pptx/code-custom/moved-layouts.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx new file mode 100644 index 000000000..5e9c2c630 Binary files /dev/null and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx new file mode 100644 index 000000000..0e640f373 Binary files /dev/null and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code-custom_deleted_layouts.pptx b/test/pptx/code-custom_deleted_layouts.pptx deleted file mode 100644 index 9282e6354..000000000 Binary files a/test/pptx/code-custom_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/code-custom_moved_layouts.pptx b/test/pptx/code-custom_moved_layouts.pptx deleted file mode 100644 index a14eeb6c8..000000000 Binary files a/test/pptx/code-custom_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/code-custom_templated.pptx b/test/pptx/code-custom_templated.pptx deleted file mode 100644 index 0e640f373..000000000 Binary files a/test/pptx/code-custom_templated.pptx and /dev/null differ diff --git a/test/pptx/code.native b/test/pptx/code.native deleted file mode 100644 index be7f512f7..000000000 --- a/test/pptx/code.native +++ /dev/null @@ -1,21 +0,0 @@ -[Header 1 ("header-with-inline-code",[],[]) [Str "Header",Space,Str "with",Space,Code ("",[],[]) "inline code"] -,CodeBlock ("",[],[]) "Code at level 0" -,BulletList - [[Para [Str "Bullet",Space,Str "item",Space,Str "with",Space,Code ("",[],[]) "inline code"] - ,CodeBlock ("",[],[]) "Code block at level 1" - ,BulletList - [[Para [Str "with",Space,Code ("",[],[]) "nested"] - ,CodeBlock ("",[],[]) "lvl2\nlvl2\nlvl2" - ,Header 2 ("second-heading-level-with-code",[],[]) [Str "Second",Space,Str "heading",Space,Str "level",Space,Str "with",Space,Code ("",[],[]) "code"]]]]] -,Header 1 ("syntax-highlighting",[],[]) [Str "Syntax",Space,Str "highlighting"] -,CodeBlock ("",["haskell"],[]) "id :: a -> a\nid x = x" -,BulletList - [[Para [Str "Nested"] - ,CodeBlock ("",["haskell"],[]) "g :: Int -> Int\ng x = x * 3"]] -,Header 1 ("two-column-slide",[],[]) [Str "Two",Space,Str "column",Space,Str "slide"] -,Div ("",["columns"],[]) - [Div ("",["column"],[("width","50%")]) - [BulletList - [[Plain [Str "A",Space,Str "total",Space,Str "alternative",Space,Str "for",Space,Code ("",[],[]) "head"]]]] - ,Div ("",["column"],[("width","50%")]) - [CodeBlock ("",[],[]) "safeHead :: [a] -> Maybe a\nsafeHead [] = Nothing\nsafeHead (x:_) = Just x"]]] diff --git a/test/pptx/code.pptx b/test/pptx/code.pptx deleted file mode 100644 index aab0cc6f5..000000000 Binary files a/test/pptx/code.pptx and /dev/null differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx new file mode 100644 index 000000000..0f503f553 Binary files /dev/null and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/code/input.native b/test/pptx/code/input.native new file mode 100644 index 000000000..be7f512f7 --- /dev/null +++ b/test/pptx/code/input.native @@ -0,0 +1,21 @@ +[Header 1 ("header-with-inline-code",[],[]) [Str "Header",Space,Str "with",Space,Code ("",[],[]) "inline code"] +,CodeBlock ("",[],[]) "Code at level 0" +,BulletList + [[Para [Str "Bullet",Space,Str "item",Space,Str "with",Space,Code ("",[],[]) "inline code"] + ,CodeBlock ("",[],[]) "Code block at level 1" + ,BulletList + [[Para [Str "with",Space,Code ("",[],[]) "nested"] + ,CodeBlock ("",[],[]) "lvl2\nlvl2\nlvl2" + ,Header 2 ("second-heading-level-with-code",[],[]) [Str "Second",Space,Str "heading",Space,Str "level",Space,Str "with",Space,Code ("",[],[]) "code"]]]]] +,Header 1 ("syntax-highlighting",[],[]) [Str "Syntax",Space,Str "highlighting"] +,CodeBlock ("",["haskell"],[]) "id :: a -> a\nid x = x" +,BulletList + [[Para [Str "Nested"] + ,CodeBlock ("",["haskell"],[]) "g :: Int -> Int\ng x = x * 3"]] +,Header 1 ("two-column-slide",[],[]) [Str "Two",Space,Str "column",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[("width","50%")]) + [BulletList + [[Plain [Str "A",Space,Str "total",Space,Str "alternative",Space,Str "for",Space,Code ("",[],[]) "head"]]]] + ,Div ("",["column"],[("width","50%")]) + [CodeBlock ("",[],[]) "safeHead :: [a] -> Maybe a\nsafeHead [] = Nothing\nsafeHead (x:_) = Just x"]]] diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx new file mode 100644 index 000000000..4d66b1310 Binary files /dev/null and b/test/pptx/code/moved-layouts.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx new file mode 100644 index 000000000..aab0cc6f5 Binary files /dev/null and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx new file mode 100644 index 000000000..a03109217 Binary files /dev/null and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/code_deleted_layouts.pptx b/test/pptx/code_deleted_layouts.pptx deleted file mode 100644 index 0f503f553..000000000 Binary files a/test/pptx/code_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/code_moved_layouts.pptx b/test/pptx/code_moved_layouts.pptx deleted file mode 100644 index 4d66b1310..000000000 Binary files a/test/pptx/code_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/code_templated.pptx b/test/pptx/code_templated.pptx deleted file mode 100644 index a03109217..000000000 Binary files a/test/pptx/code_templated.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc.native b/test/pptx/document-properties-short-desc.native deleted file mode 100644 index fe3193dc1..000000000 --- a/test/pptx/document-properties-short-desc.native +++ /dev/null @@ -1,2 +0,0 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "A.",Space,Str "M."]]),("description",MetaInlines [Str "Short",Space,RawInline (Format "html") "",Str "description",RawInline (Format "html") "",Space,Str "&."]),("keywords",MetaList [MetaInlines [Str "keyword",Space,Str "1"],MetaInlines [Str "keyword",Space,Str "2"]]),("subject",MetaInlines [Str "This",Space,Str "is",Space,Str "the",Space,Str "subject"]),("title",MetaInlines [Str "Testing",Space,Str "custom",Space,Str "properties"])]}) -[Para [Str "Testing",Space,Str "document",Space,Str "properties"]] diff --git a/test/pptx/document-properties-short-desc.pptx b/test/pptx/document-properties-short-desc.pptx deleted file mode 100644 index de5e68151..000000000 Binary files a/test/pptx/document-properties-short-desc.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx new file mode 100644 index 000000000..e4cf6bd7b Binary files /dev/null and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/input.native b/test/pptx/document-properties-short-desc/input.native new file mode 100644 index 000000000..fe3193dc1 --- /dev/null +++ b/test/pptx/document-properties-short-desc/input.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "A.",Space,Str "M."]]),("description",MetaInlines [Str "Short",Space,RawInline (Format "html") "",Str "description",RawInline (Format "html") "",Space,Str "&."]),("keywords",MetaList [MetaInlines [Str "keyword",Space,Str "1"],MetaInlines [Str "keyword",Space,Str "2"]]),("subject",MetaInlines [Str "This",Space,Str "is",Space,Str "the",Space,Str "subject"]),("title",MetaInlines [Str "Testing",Space,Str "custom",Space,Str "properties"])]}) +[Para [Str "Testing",Space,Str "document",Space,Str "properties"]] diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx new file mode 100644 index 000000000..8834f885f Binary files /dev/null and b/test/pptx/document-properties-short-desc/moved-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx new file mode 100644 index 000000000..de5e68151 Binary files /dev/null and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/templated.pptx b/test/pptx/document-properties-short-desc/templated.pptx new file mode 100644 index 000000000..d39dc0c91 Binary files /dev/null and b/test/pptx/document-properties-short-desc/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc_deleted_layouts.pptx b/test/pptx/document-properties-short-desc_deleted_layouts.pptx deleted file mode 100644 index e4cf6bd7b..000000000 Binary files a/test/pptx/document-properties-short-desc_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc_moved_layouts.pptx b/test/pptx/document-properties-short-desc_moved_layouts.pptx deleted file mode 100644 index 8834f885f..000000000 Binary files a/test/pptx/document-properties-short-desc_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc_templated.pptx b/test/pptx/document-properties-short-desc_templated.pptx deleted file mode 100644 index d39dc0c91..000000000 Binary files a/test/pptx/document-properties-short-desc_templated.pptx and /dev/null differ diff --git a/test/pptx/document-properties.native b/test/pptx/document-properties.native deleted file mode 100644 index 59ca53f4d..000000000 --- a/test/pptx/document-properties.native +++ /dev/null @@ -1,2 +0,0 @@ -Pandoc (Meta {unMeta = fromList [("Company",MetaInlines [Str "My",Space,Str "Company"]),("Second Custom Property",MetaInlines [Str "Second",Space,Str "custom",Space,Str "property",Space,Str "value"]),("abstract",MetaBlocks [Plain [Str "Quite",Space,Str "a",Space,Str "long",Space,Str "description",SoftBreak,Str "spanning",Space,Str "several",Space,Str "lines"]]),("author",MetaList [MetaInlines [Str "A.",Space,Str "M."]]),("category",MetaInlines [Str "My",Space,Str "Category"]),("custom1",MetaInlines [Str "First",Space,Str "custom",Space,Str "property",Space,Str "value"]),("custom3",MetaInlines [Str "Escaping",Space,Str "amp",Space,Str "&",Space,Str "."]),("custom4",MetaInlines [Str "Escaping",Space,Str "LT,GT",Space,Str "<",Space,Str "asdf",Space,Str ">",Space,Str "<"]),("custom5",MetaInlines [Str "Escaping",Space,Str "html",Space,RawInline (Format "html") "",Str "asdf",RawInline (Format "html") ""]),("custom6",MetaInlines [Str "Escaping",Space,Emph [Str "MD"],Space,Str "\225",Space,Str "a"]),("custom9",MetaInlines [Str "Extended",Space,Str "chars:",Space,Str "\8364",Space,Str "\225",Space,Str "\233",Space,Str "\237",Space,Str "\243",Space,Str "\250",Space,Str "$"]),("description",MetaBlocks [Para [Str "Long",Space,Str "description",Space,Str "spanning",SoftBreak,Str "several",Space,Str "lines."],Plain [Str "This",Space,Str "is",Space,Str "\225",Space,Str "second",Space,RawInline (Format "html") "",Str "line",RawInline (Format "html") "",Str "."]]),("keywords",MetaList [MetaInlines [Str "keyword",Space,Str "1"],MetaInlines [Str "keyword",Space,Str "2"]]),("lang",MetaInlines [Str "en-US"]),("nested-custom",MetaList [MetaMap (fromList [("custom 7",MetaInlines [Str "Nested",Space,Str "Custom",Space,Str "value",Space,Str "7"])]),MetaMap (fromList [("custom 8",MetaInlines [Str "Nested",Space,Str "Custom",Space,Str "value",Space,Str "8"])])]),("subject",MetaInlines [Str "This",Space,Str "is",Space,Str "the",Space,Str "subject"]),("subtitle",MetaInlines [Str "This",Space,Str "is",Space,Str "a",Space,Str "subtitle"]),("title",MetaInlines [Str "Testing",Space,Str "custom",Space,Str "properties"])]}) -[Para [Str "Testing",Space,Str "document",Space,Str "properties"]] diff --git a/test/pptx/document-properties.pptx b/test/pptx/document-properties.pptx deleted file mode 100644 index 6bcbd1b9c..000000000 Binary files a/test/pptx/document-properties.pptx and /dev/null differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx new file mode 100644 index 000000000..a00c8059d Binary files /dev/null and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/input.native b/test/pptx/document-properties/input.native new file mode 100644 index 000000000..59ca53f4d --- /dev/null +++ b/test/pptx/document-properties/input.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList [("Company",MetaInlines [Str "My",Space,Str "Company"]),("Second Custom Property",MetaInlines [Str "Second",Space,Str "custom",Space,Str "property",Space,Str "value"]),("abstract",MetaBlocks [Plain [Str "Quite",Space,Str "a",Space,Str "long",Space,Str "description",SoftBreak,Str "spanning",Space,Str "several",Space,Str "lines"]]),("author",MetaList [MetaInlines [Str "A.",Space,Str "M."]]),("category",MetaInlines [Str "My",Space,Str "Category"]),("custom1",MetaInlines [Str "First",Space,Str "custom",Space,Str "property",Space,Str "value"]),("custom3",MetaInlines [Str "Escaping",Space,Str "amp",Space,Str "&",Space,Str "."]),("custom4",MetaInlines [Str "Escaping",Space,Str "LT,GT",Space,Str "<",Space,Str "asdf",Space,Str ">",Space,Str "<"]),("custom5",MetaInlines [Str "Escaping",Space,Str "html",Space,RawInline (Format "html") "",Str "asdf",RawInline (Format "html") ""]),("custom6",MetaInlines [Str "Escaping",Space,Emph [Str "MD"],Space,Str "\225",Space,Str "a"]),("custom9",MetaInlines [Str "Extended",Space,Str "chars:",Space,Str "\8364",Space,Str "\225",Space,Str "\233",Space,Str "\237",Space,Str "\243",Space,Str "\250",Space,Str "$"]),("description",MetaBlocks [Para [Str "Long",Space,Str "description",Space,Str "spanning",SoftBreak,Str "several",Space,Str "lines."],Plain [Str "This",Space,Str "is",Space,Str "\225",Space,Str "second",Space,RawInline (Format "html") "",Str "line",RawInline (Format "html") "",Str "."]]),("keywords",MetaList [MetaInlines [Str "keyword",Space,Str "1"],MetaInlines [Str "keyword",Space,Str "2"]]),("lang",MetaInlines [Str "en-US"]),("nested-custom",MetaList [MetaMap (fromList [("custom 7",MetaInlines [Str "Nested",Space,Str "Custom",Space,Str "value",Space,Str "7"])]),MetaMap (fromList [("custom 8",MetaInlines [Str "Nested",Space,Str "Custom",Space,Str "value",Space,Str "8"])])]),("subject",MetaInlines [Str "This",Space,Str "is",Space,Str "the",Space,Str "subject"]),("subtitle",MetaInlines [Str "This",Space,Str "is",Space,Str "a",Space,Str "subtitle"]),("title",MetaInlines [Str "Testing",Space,Str "custom",Space,Str "properties"])]}) +[Para [Str "Testing",Space,Str "document",Space,Str "properties"]] diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx new file mode 100644 index 000000000..c1d2d5282 Binary files /dev/null and b/test/pptx/document-properties/moved-layouts.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx new file mode 100644 index 000000000..6bcbd1b9c Binary files /dev/null and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/document-properties/templated.pptx b/test/pptx/document-properties/templated.pptx new file mode 100644 index 000000000..841ae8c42 Binary files /dev/null and b/test/pptx/document-properties/templated.pptx differ diff --git a/test/pptx/document-properties_deleted_layouts.pptx b/test/pptx/document-properties_deleted_layouts.pptx deleted file mode 100644 index a00c8059d..000000000 Binary files a/test/pptx/document-properties_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties_moved_layouts.pptx b/test/pptx/document-properties_moved_layouts.pptx deleted file mode 100644 index c1d2d5282..000000000 Binary files a/test/pptx/document-properties_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties_templated.pptx b/test/pptx/document-properties_templated.pptx deleted file mode 100644 index 841ae8c42..000000000 Binary files a/test/pptx/document-properties_templated.pptx and /dev/null differ diff --git a/test/pptx/endnotes-toc/deleted-layouts.pptx b/test/pptx/endnotes-toc/deleted-layouts.pptx new file mode 100644 index 000000000..46708544c Binary files /dev/null and b/test/pptx/endnotes-toc/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes-toc/moved-layouts.pptx b/test/pptx/endnotes-toc/moved-layouts.pptx new file mode 100644 index 000000000..d1200bd7d Binary files /dev/null and b/test/pptx/endnotes-toc/moved-layouts.pptx differ diff --git a/test/pptx/endnotes-toc/output.pptx b/test/pptx/endnotes-toc/output.pptx new file mode 100644 index 000000000..a028b346f Binary files /dev/null and b/test/pptx/endnotes-toc/output.pptx differ diff --git a/test/pptx/endnotes-toc/templated.pptx b/test/pptx/endnotes-toc/templated.pptx new file mode 100644 index 000000000..38a0c437d Binary files /dev/null and b/test/pptx/endnotes-toc/templated.pptx differ diff --git a/test/pptx/endnotes.native b/test/pptx/endnotes.native deleted file mode 100644 index f6caeb62f..000000000 --- a/test/pptx/endnotes.native +++ /dev/null @@ -1,2 +0,0 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Str "Here",Space,Str "is",Space,Str "one",Space,Str "note.",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "note."]],Space,Str "And",Space,Str "one",Space,Str "more",Space,Str "note.",Note [Para [Str "And",Space,Str "another",Space,Str "note."]]]] diff --git a/test/pptx/endnotes.pptx b/test/pptx/endnotes.pptx deleted file mode 100644 index 9d46036fe..000000000 Binary files a/test/pptx/endnotes.pptx and /dev/null differ diff --git a/test/pptx/endnotes/deleted-layouts.pptx b/test/pptx/endnotes/deleted-layouts.pptx new file mode 100644 index 000000000..5c69a6310 Binary files /dev/null and b/test/pptx/endnotes/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes/input.native b/test/pptx/endnotes/input.native new file mode 100644 index 000000000..f6caeb62f --- /dev/null +++ b/test/pptx/endnotes/input.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Str "Here",Space,Str "is",Space,Str "one",Space,Str "note.",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "note."]],Space,Str "And",Space,Str "one",Space,Str "more",Space,Str "note.",Note [Para [Str "And",Space,Str "another",Space,Str "note."]]]] diff --git a/test/pptx/endnotes/moved-layouts.pptx b/test/pptx/endnotes/moved-layouts.pptx new file mode 100644 index 000000000..0d4c491b9 Binary files /dev/null and b/test/pptx/endnotes/moved-layouts.pptx differ diff --git a/test/pptx/endnotes/output.pptx b/test/pptx/endnotes/output.pptx new file mode 100644 index 000000000..9d46036fe Binary files /dev/null and b/test/pptx/endnotes/output.pptx differ diff --git a/test/pptx/endnotes/templated.pptx b/test/pptx/endnotes/templated.pptx new file mode 100644 index 000000000..863cc29d4 Binary files /dev/null and b/test/pptx/endnotes/templated.pptx differ diff --git a/test/pptx/endnotes_deleted_layouts.pptx b/test/pptx/endnotes_deleted_layouts.pptx deleted file mode 100644 index 5c69a6310..000000000 Binary files a/test/pptx/endnotes_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes_moved_layouts.pptx b/test/pptx/endnotes_moved_layouts.pptx deleted file mode 100644 index 0d4c491b9..000000000 Binary files a/test/pptx/endnotes_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes_templated.pptx b/test/pptx/endnotes_templated.pptx deleted file mode 100644 index 863cc29d4..000000000 Binary files a/test/pptx/endnotes_templated.pptx and /dev/null differ diff --git a/test/pptx/endnotes_toc.pptx b/test/pptx/endnotes_toc.pptx deleted file mode 100644 index a028b346f..000000000 Binary files a/test/pptx/endnotes_toc.pptx and /dev/null differ diff --git a/test/pptx/endnotes_toc_deleted_layouts.pptx b/test/pptx/endnotes_toc_deleted_layouts.pptx deleted file mode 100644 index 46708544c..000000000 Binary files a/test/pptx/endnotes_toc_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes_toc_moved_layouts.pptx b/test/pptx/endnotes_toc_moved_layouts.pptx deleted file mode 100644 index d1200bd7d..000000000 Binary files a/test/pptx/endnotes_toc_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes_toc_templated.pptx b/test/pptx/endnotes_toc_templated.pptx deleted file mode 100644 index 38a0c437d..000000000 Binary files a/test/pptx/endnotes_toc_templated.pptx and /dev/null differ diff --git a/test/pptx/images.native b/test/pptx/images.native deleted file mode 100644 index 54827e5cc..000000000 --- a/test/pptx/images.native +++ /dev/null @@ -1,5 +0,0 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Image ("",[],[]) [] ("lalune.jpg","")] -,Para [Image ("",[],[]) [Str "The",Space,Str "Moon"] ("lalune.jpg","fig:")] -,Header 1 ("one-more",[],[]) [Str "One",Space,Str "More"] -,Para [Image ("",[],[]) [Str "The",Space,Str "Moon"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/images.pptx b/test/pptx/images.pptx deleted file mode 100644 index 89325e577..000000000 Binary files a/test/pptx/images.pptx and /dev/null differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx new file mode 100644 index 000000000..053928863 Binary files /dev/null and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/images/input.native b/test/pptx/images/input.native new file mode 100644 index 000000000..54827e5cc --- /dev/null +++ b/test/pptx/images/input.native @@ -0,0 +1,5 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Image ("",[],[]) [] ("lalune.jpg","")] +,Para [Image ("",[],[]) [Str "The",Space,Str "Moon"] ("lalune.jpg","fig:")] +,Header 1 ("one-more",[],[]) [Str "One",Space,Str "More"] +,Para [Image ("",[],[]) [Str "The",Space,Str "Moon"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx new file mode 100644 index 000000000..7951a09f6 Binary files /dev/null and b/test/pptx/images/moved-layouts.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx new file mode 100644 index 000000000..89325e577 Binary files /dev/null and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/images/templated.pptx b/test/pptx/images/templated.pptx new file mode 100644 index 000000000..7c0ed9a17 Binary files /dev/null and b/test/pptx/images/templated.pptx differ diff --git a/test/pptx/images_deleted_layouts.pptx b/test/pptx/images_deleted_layouts.pptx deleted file mode 100644 index 053928863..000000000 Binary files a/test/pptx/images_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/images_moved_layouts.pptx b/test/pptx/images_moved_layouts.pptx deleted file mode 100644 index 7951a09f6..000000000 Binary files a/test/pptx/images_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/images_templated.pptx b/test/pptx/images_templated.pptx deleted file mode 100644 index 7c0ed9a17..000000000 Binary files a/test/pptx/images_templated.pptx and /dev/null differ diff --git a/test/pptx/inline-formatting/deleted-layouts.pptx b/test/pptx/inline-formatting/deleted-layouts.pptx new file mode 100644 index 000000000..bbd5bfeb4 Binary files /dev/null and b/test/pptx/inline-formatting/deleted-layouts.pptx differ diff --git a/test/pptx/inline-formatting/input.native b/test/pptx/inline-formatting/input.native new file mode 100644 index 000000000..164176af2 --- /dev/null +++ b/test/pptx/inline-formatting/input.native @@ -0,0 +1,5 @@ +[Para [Str "Here",Space,Str "are",Space,Str "examples",Space,Str "of",Space,Emph [Str "italics"],Str ",",Space,Strong [Str "bold"],Str ",",Space,Str "and",Space,Strong [Emph [Str "bold",Space,Str "italics"]],Str "."] +,Para [Str "Here",Space,Str "is",Space,Strikeout [Str "strook-three"],Space,Str "strike-through",Space,Str "and",Space,SmallCaps [Str "small",Space,Str "caps"],Str "."] +,Para [Str "Here",Space,Str "is",Space,Span ("",["underline"],[]) [Str "some",Space,Emph [Str "underlined"],Space,Strong [Str "text"]],Str "."] +,Para [Str "We",Space,Str "can",Space,Str "also",Space,Str "do",Space,Str "subscripts",Space,Str "(H",Subscript [Str "2"],Str "0)",Space,Str "and",Space,Str "super",Superscript [Str "script"],Str "."] +,RawBlock (Format "html") ""] diff --git a/test/pptx/inline-formatting/moved-layouts.pptx b/test/pptx/inline-formatting/moved-layouts.pptx new file mode 100644 index 000000000..427492130 Binary files /dev/null and b/test/pptx/inline-formatting/moved-layouts.pptx differ diff --git a/test/pptx/inline-formatting/output.pptx b/test/pptx/inline-formatting/output.pptx new file mode 100644 index 000000000..473b9498d Binary files /dev/null and b/test/pptx/inline-formatting/output.pptx differ diff --git a/test/pptx/inline-formatting/templated.pptx b/test/pptx/inline-formatting/templated.pptx new file mode 100644 index 000000000..dd778a102 Binary files /dev/null and b/test/pptx/inline-formatting/templated.pptx differ diff --git a/test/pptx/inline_formatting.native b/test/pptx/inline_formatting.native deleted file mode 100644 index 164176af2..000000000 --- a/test/pptx/inline_formatting.native +++ /dev/null @@ -1,5 +0,0 @@ -[Para [Str "Here",Space,Str "are",Space,Str "examples",Space,Str "of",Space,Emph [Str "italics"],Str ",",Space,Strong [Str "bold"],Str ",",Space,Str "and",Space,Strong [Emph [Str "bold",Space,Str "italics"]],Str "."] -,Para [Str "Here",Space,Str "is",Space,Strikeout [Str "strook-three"],Space,Str "strike-through",Space,Str "and",Space,SmallCaps [Str "small",Space,Str "caps"],Str "."] -,Para [Str "Here",Space,Str "is",Space,Span ("",["underline"],[]) [Str "some",Space,Emph [Str "underlined"],Space,Strong [Str "text"]],Str "."] -,Para [Str "We",Space,Str "can",Space,Str "also",Space,Str "do",Space,Str "subscripts",Space,Str "(H",Subscript [Str "2"],Str "0)",Space,Str "and",Space,Str "super",Superscript [Str "script"],Str "."] -,RawBlock (Format "html") ""] diff --git a/test/pptx/inline_formatting.pptx b/test/pptx/inline_formatting.pptx deleted file mode 100644 index 473b9498d..000000000 Binary files a/test/pptx/inline_formatting.pptx and /dev/null differ diff --git a/test/pptx/inline_formatting_deleted_layouts.pptx b/test/pptx/inline_formatting_deleted_layouts.pptx deleted file mode 100644 index bbd5bfeb4..000000000 Binary files a/test/pptx/inline_formatting_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/inline_formatting_moved_layouts.pptx b/test/pptx/inline_formatting_moved_layouts.pptx deleted file mode 100644 index 427492130..000000000 Binary files a/test/pptx/inline_formatting_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/inline_formatting_templated.pptx b/test/pptx/inline_formatting_templated.pptx deleted file mode 100644 index dd778a102..000000000 Binary files a/test/pptx/inline_formatting_templated.pptx and /dev/null differ diff --git a/test/pptx/lists.native b/test/pptx/lists.native deleted file mode 100644 index 61249c7fe..000000000 --- a/test/pptx/lists.native +++ /dev/null @@ -1,18 +0,0 @@ -[Header 1 ("lists",[],[]) [Str "Lists"] -,BulletList - [[Para [Str "Bulleted",Space,Str "bulleted",Space,Str "lists."]] - ,[Para [Str "And",Space,Str "go",Space,Str "to",Space,Str "arbitrary",Space,Str "depth."] - ,BulletList - [[Para [Str "Like",Space,Str "this"] - ,BulletList - [[Plain [Str "Or",Space,Str "this"]]]] - ,[Para [Str "Back",Space,Str "to",Space,Str "here."]]]]] -,Header 1 ("lists-continued",[],[]) [Str "Lists",Space,Str "(continued)"] -,Para [Str "Lists",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "numbered:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "Tomatoes"]] - ,[Para [Str "Potatoes",Space,Str "of",Space,Str "various",Space,Str "sorts"] - ,OrderedList (1,LowerAlpha,Period) - [[Para [Str "sweet",Space,Str "potatoes"]] - ,[Para [Str "russet",Space,Str "potates"]]]] - ,[Para [Str "Tornadoes,",Space,Str "for",Space,Str "the",Space,Str "rhyme."]]]] diff --git a/test/pptx/lists.pptx b/test/pptx/lists.pptx deleted file mode 100644 index ffc2eb9f7..000000000 Binary files a/test/pptx/lists.pptx and /dev/null differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx new file mode 100644 index 000000000..6512e44bb Binary files /dev/null and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/lists/input.native b/test/pptx/lists/input.native new file mode 100644 index 000000000..61249c7fe --- /dev/null +++ b/test/pptx/lists/input.native @@ -0,0 +1,18 @@ +[Header 1 ("lists",[],[]) [Str "Lists"] +,BulletList + [[Para [Str "Bulleted",Space,Str "bulleted",Space,Str "lists."]] + ,[Para [Str "And",Space,Str "go",Space,Str "to",Space,Str "arbitrary",Space,Str "depth."] + ,BulletList + [[Para [Str "Like",Space,Str "this"] + ,BulletList + [[Plain [Str "Or",Space,Str "this"]]]] + ,[Para [Str "Back",Space,Str "to",Space,Str "here."]]]]] +,Header 1 ("lists-continued",[],[]) [Str "Lists",Space,Str "(continued)"] +,Para [Str "Lists",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "numbered:"] +,OrderedList (1,Decimal,Period) + [[Para [Str "Tomatoes"]] + ,[Para [Str "Potatoes",Space,Str "of",Space,Str "various",Space,Str "sorts"] + ,OrderedList (1,LowerAlpha,Period) + [[Para [Str "sweet",Space,Str "potatoes"]] + ,[Para [Str "russet",Space,Str "potates"]]]] + ,[Para [Str "Tornadoes,",Space,Str "for",Space,Str "the",Space,Str "rhyme."]]]] diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx new file mode 100644 index 000000000..2947c3211 Binary files /dev/null and b/test/pptx/lists/moved-layouts.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx new file mode 100644 index 000000000..ffc2eb9f7 Binary files /dev/null and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx new file mode 100644 index 000000000..2493e7890 Binary files /dev/null and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/lists_deleted_layouts.pptx b/test/pptx/lists_deleted_layouts.pptx deleted file mode 100644 index 6512e44bb..000000000 Binary files a/test/pptx/lists_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/lists_moved_layouts.pptx b/test/pptx/lists_moved_layouts.pptx deleted file mode 100644 index 2947c3211..000000000 Binary files a/test/pptx/lists_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/lists_templated.pptx b/test/pptx/lists_templated.pptx deleted file mode 100644 index 2493e7890..000000000 Binary files a/test/pptx/lists_templated.pptx and /dev/null differ diff --git a/test/pptx/raw-ooxml/deleted-layouts.pptx b/test/pptx/raw-ooxml/deleted-layouts.pptx new file mode 100644 index 000000000..2ea155657 Binary files /dev/null and b/test/pptx/raw-ooxml/deleted-layouts.pptx differ diff --git a/test/pptx/raw-ooxml/input.native b/test/pptx/raw-ooxml/input.native new file mode 100644 index 000000000..ae5bdd140 --- /dev/null +++ b/test/pptx/raw-ooxml/input.native @@ -0,0 +1,3 @@ +[Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "text,",Space,Str "written",Space,Str "as",Space,Str "a",Space,Str "raw",Space,Str "inline:",Space,RawInline (Format "openxml") "Here are examples of italics, bold"] +,HorizontalRule +,RawBlock (Format "openxml") "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Bulleted bulleted lists.\n \n \n \n \n \n \n And go to arbitrary depth.\n \n \n \n \n \n \n Like this\n \n \n \n \n \n \n Or this\n \n \n \n \n \n \n Back to here.\n \n \n \n "] diff --git a/test/pptx/raw-ooxml/moved-layouts.pptx b/test/pptx/raw-ooxml/moved-layouts.pptx new file mode 100644 index 000000000..e58304172 Binary files /dev/null and b/test/pptx/raw-ooxml/moved-layouts.pptx differ diff --git a/test/pptx/raw-ooxml/output.pptx b/test/pptx/raw-ooxml/output.pptx new file mode 100644 index 000000000..29164af15 Binary files /dev/null and b/test/pptx/raw-ooxml/output.pptx differ diff --git a/test/pptx/raw-ooxml/templated.pptx b/test/pptx/raw-ooxml/templated.pptx new file mode 100644 index 000000000..0f20f9826 Binary files /dev/null and b/test/pptx/raw-ooxml/templated.pptx differ diff --git a/test/pptx/raw_ooxml.native b/test/pptx/raw_ooxml.native deleted file mode 100644 index ae5bdd140..000000000 --- a/test/pptx/raw_ooxml.native +++ /dev/null @@ -1,3 +0,0 @@ -[Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "text,",Space,Str "written",Space,Str "as",Space,Str "a",Space,Str "raw",Space,Str "inline:",Space,RawInline (Format "openxml") "Here are examples of italics, bold"] -,HorizontalRule -,RawBlock (Format "openxml") "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Bulleted bulleted lists.\n \n \n \n \n \n \n And go to arbitrary depth.\n \n \n \n \n \n \n Like this\n \n \n \n \n \n \n Or this\n \n \n \n \n \n \n Back to here.\n \n \n \n "] diff --git a/test/pptx/raw_ooxml.pptx b/test/pptx/raw_ooxml.pptx deleted file mode 100644 index 29164af15..000000000 Binary files a/test/pptx/raw_ooxml.pptx and /dev/null differ diff --git a/test/pptx/raw_ooxml_deleted_layouts.pptx b/test/pptx/raw_ooxml_deleted_layouts.pptx deleted file mode 100644 index 2ea155657..000000000 Binary files a/test/pptx/raw_ooxml_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/raw_ooxml_moved_layouts.pptx b/test/pptx/raw_ooxml_moved_layouts.pptx deleted file mode 100644 index e58304172..000000000 Binary files a/test/pptx/raw_ooxml_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/raw_ooxml_templated.pptx b/test/pptx/raw_ooxml_templated.pptx deleted file mode 100644 index 0f20f9826..000000000 Binary files a/test/pptx/raw_ooxml_templated.pptx and /dev/null differ diff --git a/test/pptx/reference-deleted-layouts.pptx b/test/pptx/reference-deleted-layouts.pptx new file mode 100644 index 000000000..a9a74ecd5 Binary files /dev/null and b/test/pptx/reference-deleted-layouts.pptx differ diff --git a/test/pptx/reference-depth.pptx b/test/pptx/reference-depth.pptx new file mode 100644 index 000000000..97f444788 Binary files /dev/null and b/test/pptx/reference-depth.pptx differ diff --git a/test/pptx/reference-moved-layouts.pptx b/test/pptx/reference-moved-layouts.pptx new file mode 100644 index 000000000..72c4f3fd7 Binary files /dev/null and b/test/pptx/reference-moved-layouts.pptx differ diff --git a/test/pptx/reference_deleted_layouts.pptx b/test/pptx/reference_deleted_layouts.pptx deleted file mode 100644 index a9a74ecd5..000000000 Binary files a/test/pptx/reference_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/reference_depth.pptx b/test/pptx/reference_depth.pptx deleted file mode 100644 index 97f444788..000000000 Binary files a/test/pptx/reference_depth.pptx and /dev/null differ diff --git a/test/pptx/reference_moved_layouts.pptx b/test/pptx/reference_moved_layouts.pptx deleted file mode 100644 index 72c4f3fd7..000000000 Binary files a/test/pptx/reference_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/remove-empty-slides/deleted-layouts.pptx b/test/pptx/remove-empty-slides/deleted-layouts.pptx new file mode 100644 index 000000000..7ae4a5fab Binary files /dev/null and b/test/pptx/remove-empty-slides/deleted-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/input.native b/test/pptx/remove-empty-slides/input.native new file mode 100644 index 000000000..51c042281 --- /dev/null +++ b/test/pptx/remove-empty-slides/input.native @@ -0,0 +1,5 @@ +[Para [Str "Content"] +,Para [Image ("",[],[]) [] ("lalune.jpg",""),Space,RawInline (Format "html") ""] +,HorizontalRule +,HorizontalRule +,Para [Str "More",Space,Str "content"]] diff --git a/test/pptx/remove-empty-slides/moved-layouts.pptx b/test/pptx/remove-empty-slides/moved-layouts.pptx new file mode 100644 index 000000000..2572f2447 Binary files /dev/null and b/test/pptx/remove-empty-slides/moved-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/output.pptx b/test/pptx/remove-empty-slides/output.pptx new file mode 100644 index 000000000..c6df8e18e Binary files /dev/null and b/test/pptx/remove-empty-slides/output.pptx differ diff --git a/test/pptx/remove-empty-slides/templated.pptx b/test/pptx/remove-empty-slides/templated.pptx new file mode 100644 index 000000000..1df48c5ad Binary files /dev/null and b/test/pptx/remove-empty-slides/templated.pptx differ diff --git a/test/pptx/remove_empty_slides.native b/test/pptx/remove_empty_slides.native deleted file mode 100644 index 51c042281..000000000 --- a/test/pptx/remove_empty_slides.native +++ /dev/null @@ -1,5 +0,0 @@ -[Para [Str "Content"] -,Para [Image ("",[],[]) [] ("lalune.jpg",""),Space,RawInline (Format "html") ""] -,HorizontalRule -,HorizontalRule -,Para [Str "More",Space,Str "content"]] diff --git a/test/pptx/remove_empty_slides.pptx b/test/pptx/remove_empty_slides.pptx deleted file mode 100644 index c6df8e18e..000000000 Binary files a/test/pptx/remove_empty_slides.pptx and /dev/null differ diff --git a/test/pptx/remove_empty_slides_deleted_layouts.pptx b/test/pptx/remove_empty_slides_deleted_layouts.pptx deleted file mode 100644 index 7ae4a5fab..000000000 Binary files a/test/pptx/remove_empty_slides_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/remove_empty_slides_moved_layouts.pptx b/test/pptx/remove_empty_slides_moved_layouts.pptx deleted file mode 100644 index 2572f2447..000000000 Binary files a/test/pptx/remove_empty_slides_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/remove_empty_slides_templated.pptx b/test/pptx/remove_empty_slides_templated.pptx deleted file mode 100644 index 1df48c5ad..000000000 Binary files a/test/pptx/remove_empty_slides_templated.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx new file mode 100644 index 000000000..2c7fd4d8b Binary files /dev/null and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx new file mode 100644 index 000000000..8471b1d10 Binary files /dev/null and b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx new file mode 100644 index 000000000..449339778 Binary files /dev/null and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/templated.pptx b/test/pptx/slide-breaks-slide-level-1/templated.pptx new file mode 100644 index 000000000..e2815159a Binary files /dev/null and b/test/pptx/slide-breaks-slide-level-1/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx new file mode 100644 index 000000000..1e0b76d46 Binary files /dev/null and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx new file mode 100644 index 000000000..918264bc5 Binary files /dev/null and b/test/pptx/slide-breaks-toc/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx new file mode 100644 index 000000000..9dbfa41a0 Binary files /dev/null and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx new file mode 100644 index 000000000..b83f3f596 Binary files /dev/null and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx new file mode 100644 index 000000000..86dfad3b2 Binary files /dev/null and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/input.native b/test/pptx/slide-breaks/input.native new file mode 100644 index 000000000..084c61737 --- /dev/null +++ b/test/pptx/slide-breaks/input.native @@ -0,0 +1,7 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Str "Break",Space,Str "with",Space,Str "a",Space,Str "new",Space,Str "section-level",Space,Str "header"] +,Header 1 ("below-section-level",[],[]) [Str "Below",Space,Str "section-level"] +,Header 2 ("section-level",[],[]) [Str "Section-level"] +,Para [Str "Third",Space,Str "slide",Space,Str "(with",Space,Str "a",Space,Str "section-level",Space,Str "of",Space,Str "2)"] +,HorizontalRule +,Para [Str "This",Space,Str "is",Space,Str "another",Space,Str "slide."]] diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx new file mode 100644 index 000000000..90b3b94a6 Binary files /dev/null and b/test/pptx/slide-breaks/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx new file mode 100644 index 000000000..e06d9079d Binary files /dev/null and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-breaks/templated.pptx b/test/pptx/slide-breaks/templated.pptx new file mode 100644 index 000000000..71ba99701 Binary files /dev/null and b/test/pptx/slide-breaks/templated.pptx differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table.native b/test/pptx/slide-level-0-h1-h2-with-table.native deleted file mode 100644 index c6e65ecf5..000000000 --- a/test/pptx/slide-level-0-h1-h2-with-table.native +++ /dev/null @@ -1,14 +0,0 @@ -[Header 1 ("hello",[],[]) [Str "Hello"] -,Header 2 ("there",[],[]) [Str "There"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 5.555555555555555e-2)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - [])] diff --git a/test/pptx/slide-level-0-h1-h2-with-table.pptx b/test/pptx/slide-level-0-h1-h2-with-table.pptx deleted file mode 100644 index 197a6833f..000000000 Binary files a/test/pptx/slide-level-0-h1-h2-with-table.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx deleted file mode 100644 index 5e776e05c..000000000 Binary files a/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx b/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx deleted file mode 100644 index 35204de1b..000000000 Binary files a/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx b/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx deleted file mode 100644 index 5c659952e..000000000 Binary files a/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-image.native b/test/pptx/slide-level-0-h1-with-image.native deleted file mode 100644 index 0f5033b54..000000000 --- a/test/pptx/slide-level-0-h1-with-image.native +++ /dev/null @@ -1,2 +0,0 @@ -[Header 1 ("hello",[],[]) [Str "Hello"] -,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0-h1-with-image.pptx b/test/pptx/slide-level-0-h1-with-image.pptx deleted file mode 100644 index 2f3a53f5c..000000000 Binary files a/test/pptx/slide-level-0-h1-with-image.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx deleted file mode 100644 index 16c61d1be..000000000 Binary files a/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx b/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx deleted file mode 100644 index 395036069..000000000 Binary files a/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-image_templated.pptx b/test/pptx/slide-level-0-h1-with-image_templated.pptx deleted file mode 100644 index d306375e9..000000000 Binary files a/test/pptx/slide-level-0-h1-with-image_templated.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-table.native b/test/pptx/slide-level-0-h1-with-table.native deleted file mode 100644 index b961e900d..000000000 --- a/test/pptx/slide-level-0-h1-with-table.native +++ /dev/null @@ -1,13 +0,0 @@ -[Header 1 ("hello",[],[]) [Str "Hello"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 5.555555555555555e-2)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - [])] diff --git a/test/pptx/slide-level-0-h1-with-table.pptx b/test/pptx/slide-level-0-h1-with-table.pptx deleted file mode 100644 index 44dbbf90c..000000000 Binary files a/test/pptx/slide-level-0-h1-with-table.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx deleted file mode 100644 index 0eb7c0b08..000000000 Binary files a/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx b/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx deleted file mode 100644 index 197499bc3..000000000 Binary files a/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-table_templated.pptx b/test/pptx/slide-level-0-h1-with-table_templated.pptx deleted file mode 100644 index 87b45dda2..000000000 Binary files a/test/pptx/slide-level-0-h1-with-table_templated.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h2-with-image.native b/test/pptx/slide-level-0-h2-with-image.native deleted file mode 100644 index 5def0cb92..000000000 --- a/test/pptx/slide-level-0-h2-with-image.native +++ /dev/null @@ -1,2 +0,0 @@ -[Header 2 ("hello",[],[]) [Str "Hello"] -,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0-h2-with-image.pptx b/test/pptx/slide-level-0-h2-with-image.pptx deleted file mode 100644 index 948659d6a..000000000 Binary files a/test/pptx/slide-level-0-h2-with-image.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx b/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx deleted file mode 100644 index afc096ce6..000000000 Binary files a/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx b/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx deleted file mode 100644 index 395036069..000000000 Binary files a/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h2-with-image_templated.pptx b/test/pptx/slide-level-0-h2-with-image_templated.pptx deleted file mode 100644 index d306375e9..000000000 Binary files a/test/pptx/slide-level-0-h2-with-image_templated.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx new file mode 100644 index 000000000..5e776e05c Binary files /dev/null and b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/input.native b/test/pptx/slide-level-0/h1-h2-with-table/input.native new file mode 100644 index 000000000..c6e65ecf5 --- /dev/null +++ b/test/pptx/slide-level-0/h1-h2-with-table/input.native @@ -0,0 +1,14 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Header 2 ("there",[],[]) [Str "There"] +,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + [])] diff --git a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx new file mode 100644 index 000000000..35204de1b Binary files /dev/null and b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx new file mode 100644 index 000000000..197a6833f Binary files /dev/null and b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx new file mode 100644 index 000000000..5c659952e Binary files /dev/null and b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx new file mode 100644 index 000000000..16c61d1be Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/input.native b/test/pptx/slide-level-0/h1-with-image/input.native new file mode 100644 index 000000000..0f5033b54 --- /dev/null +++ b/test/pptx/slide-level-0/h1-with-image/input.native @@ -0,0 +1,2 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx new file mode 100644 index 000000000..395036069 Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx new file mode 100644 index 000000000..2f3a53f5c Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/templated.pptx b/test/pptx/slide-level-0/h1-with-image/templated.pptx new file mode 100644 index 000000000..d306375e9 Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-image/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx new file mode 100644 index 000000000..0eb7c0b08 Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/input.native b/test/pptx/slide-level-0/h1-with-table/input.native new file mode 100644 index 000000000..b961e900d --- /dev/null +++ b/test/pptx/slide-level-0/h1-with-table/input.native @@ -0,0 +1,13 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + [])] diff --git a/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx new file mode 100644 index 000000000..197499bc3 Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/output.pptx b/test/pptx/slide-level-0/h1-with-table/output.pptx new file mode 100644 index 000000000..44dbbf90c Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/templated.pptx b/test/pptx/slide-level-0/h1-with-table/templated.pptx new file mode 100644 index 000000000..87b45dda2 Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-table/templated.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx new file mode 100644 index 000000000..afc096ce6 Binary files /dev/null and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/input.native b/test/pptx/slide-level-0/h2-with-image/input.native new file mode 100644 index 000000000..5def0cb92 --- /dev/null +++ b/test/pptx/slide-level-0/h2-with-image/input.native @@ -0,0 +1,2 @@ +[Header 2 ("hello",[],[]) [Str "Hello"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx new file mode 100644 index 000000000..395036069 Binary files /dev/null and b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx new file mode 100644 index 000000000..948659d6a Binary files /dev/null and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/templated.pptx b/test/pptx/slide-level-0/h2-with-image/templated.pptx new file mode 100644 index 000000000..d306375e9 Binary files /dev/null and b/test/pptx/slide-level-0/h2-with-image/templated.pptx differ diff --git a/test/pptx/slide_breaks.native b/test/pptx/slide_breaks.native deleted file mode 100644 index 084c61737..000000000 --- a/test/pptx/slide_breaks.native +++ /dev/null @@ -1,7 +0,0 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Str "Break",Space,Str "with",Space,Str "a",Space,Str "new",Space,Str "section-level",Space,Str "header"] -,Header 1 ("below-section-level",[],[]) [Str "Below",Space,Str "section-level"] -,Header 2 ("section-level",[],[]) [Str "Section-level"] -,Para [Str "Third",Space,Str "slide",Space,Str "(with",Space,Str "a",Space,Str "section-level",Space,Str "of",Space,Str "2)"] -,HorizontalRule -,Para [Str "This",Space,Str "is",Space,Str "another",Space,Str "slide."]] diff --git a/test/pptx/slide_breaks.pptx b/test/pptx/slide_breaks.pptx deleted file mode 100644 index e06d9079d..000000000 Binary files a/test/pptx/slide_breaks.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_deleted_layouts.pptx b/test/pptx/slide_breaks_deleted_layouts.pptx deleted file mode 100644 index 86dfad3b2..000000000 Binary files a/test/pptx/slide_breaks_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_moved_layouts.pptx b/test/pptx/slide_breaks_moved_layouts.pptx deleted file mode 100644 index 90b3b94a6..000000000 Binary files a/test/pptx/slide_breaks_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_slide_level_1.pptx b/test/pptx/slide_breaks_slide_level_1.pptx deleted file mode 100644 index 449339778..000000000 Binary files a/test/pptx/slide_breaks_slide_level_1.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx b/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx deleted file mode 100644 index 2c7fd4d8b..000000000 Binary files a/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx b/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx deleted file mode 100644 index 8471b1d10..000000000 Binary files a/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_slide_level_1_templated.pptx b/test/pptx/slide_breaks_slide_level_1_templated.pptx deleted file mode 100644 index e2815159a..000000000 Binary files a/test/pptx/slide_breaks_slide_level_1_templated.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_templated.pptx b/test/pptx/slide_breaks_templated.pptx deleted file mode 100644 index 71ba99701..000000000 Binary files a/test/pptx/slide_breaks_templated.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_toc.pptx b/test/pptx/slide_breaks_toc.pptx deleted file mode 100644 index 9dbfa41a0..000000000 Binary files a/test/pptx/slide_breaks_toc.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_toc_deleted_layouts.pptx b/test/pptx/slide_breaks_toc_deleted_layouts.pptx deleted file mode 100644 index 1e0b76d46..000000000 Binary files a/test/pptx/slide_breaks_toc_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_toc_moved_layouts.pptx b/test/pptx/slide_breaks_toc_moved_layouts.pptx deleted file mode 100644 index 918264bc5..000000000 Binary files a/test/pptx/slide_breaks_toc_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_toc_templated.pptx b/test/pptx/slide_breaks_toc_templated.pptx deleted file mode 100644 index b83f3f596..000000000 Binary files a/test/pptx/slide_breaks_toc_templated.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx new file mode 100644 index 000000000..1298870e2 Binary files /dev/null and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/input.native b/test/pptx/speaker-notes-after-metadata/input.native new file mode 100644 index 000000000..6fda4b1ab --- /dev/null +++ b/test/pptx/speaker-notes-after-metadata/input.native @@ -0,0 +1,5 @@ +Pandoc (Meta {unMeta = fromList [("author",MetaInlines [Str "Jesse",Space,Str "Rosenthal"]),("title",MetaInlines [Str "Testing"])]}) +[Div ("",["notes"],[]) + [Para [Str "Some",Space,Str "speaker",Space,Str "notes"]] +,Header 1 ("a-header",[],[]) [Str "A",Space,Str "header"] +,Para [Str "And",Space,Str "a",Space,Str "new",Space,Str "slide."]] diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx new file mode 100644 index 000000000..b844a0b51 Binary files /dev/null and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx new file mode 100644 index 000000000..6343bffe4 Binary files /dev/null and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx new file mode 100644 index 000000000..8d27c4c68 Binary files /dev/null and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx new file mode 100644 index 000000000..853b918cb Binary files /dev/null and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/input.native b/test/pptx/speaker-notes-afterheader/input.native new file mode 100644 index 000000000..0f7dd95d7 --- /dev/null +++ b/test/pptx/speaker-notes-afterheader/input.native @@ -0,0 +1,3 @@ +[Header 1 ("here-is-a-single-header",[],[]) [Str "Here",Space,Str "is",Space,Str "a",Space,Str "single",Space,Str "header"] +,Div ("",["notes"],[]) + [Para [Str "and",Space,Str "here",Space,Str "are",Space,Str "some",Space,Str "notes"]]] diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx new file mode 100644 index 000000000..9fff9f855 Binary files /dev/null and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx new file mode 100644 index 000000000..d581681aa Binary files /dev/null and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx new file mode 100644 index 000000000..d8d8481df Binary files /dev/null and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx new file mode 100644 index 000000000..9fec1c279 Binary files /dev/null and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/input.native b/test/pptx/speaker-notes-afterseps/input.native new file mode 100644 index 000000000..4fd7b1ccb --- /dev/null +++ b/test/pptx/speaker-notes-afterseps/input.native @@ -0,0 +1,63 @@ +[Para [Image ("",[],[]) [Str "The",Space,Str "moon"] ("lalune.jpg","fig:")] +,Div ("",["notes"],[]) + [Para [Str "chicken",Space,Str "and",Space,Str "dumplings"]] +,Table ("",[],[]) (Caption Nothing + [Para [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax,",Space,Str "with",Space,Str "alignment"]]) + [(AlignRight,ColWidthDefault) + ,(AlignLeft,ColWidthDefault) + ,(AlignCenter,ColWidthDefault) + ,(AlignDefault,ColWidthDefault)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Right"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Left"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Center"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Default"]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + []) +,Div ("",["notes"],[]) + [Para [Str "foo",Space,Str "bar"]] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [BulletList + [[Para [Str "some",Space,Str "stuff"]] + ,[Para [Str "some",Space,Str "more",Space,Str "stuff"]]] + ,Div ("",["notes"],[]) + [Para [Str "Some",Space,Str "notes",Space,Str "inside",Space,Str "a",Space,Str "column"]]] + ,Div ("",["column"],[]) + [Para [Str "Some",Space,Str "other",Space,Emph [Str "stuff"]]]] +,Div ("",["notes"],[]) + [Para [Str "Some",Space,Str "notes",Space,Str "outside",Space,Str "the",Space,Str "column"]]] \ No newline at end of file diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx new file mode 100644 index 000000000..de697cbd8 Binary files /dev/null and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx new file mode 100644 index 000000000..9542fe8b5 Binary files /dev/null and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx new file mode 100644 index 000000000..5a3d15d57 Binary files /dev/null and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx new file mode 100644 index 000000000..6a5ad524f Binary files /dev/null and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/input.native b/test/pptx/speaker-notes/input.native new file mode 100644 index 000000000..4eeca2107 --- /dev/null +++ b/test/pptx/speaker-notes/input.native @@ -0,0 +1,17 @@ +[Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "slide."] +,Div ("",["notes"],[]) + [Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "note."] + ,Para [Str "Here",Space,Str "is",Space,Emph [Str "some"],Space,Strong [Str "other"],Space,Str "formatting."]] +,HorizontalRule +,Para [Str "A",Space,Str "page",Space,Str "with",Space,Str "no",Space,Str "speaker",Space,Str "notes"] +,HorizontalRule +,Div ("",["notes"],[]) + [Para [Str "The",Space,Str "first",Space,Str "note",Space,Str "div"]] +,Para [Str "A",Space,Str "page",Space,Str "with",Space,Str "two",Space,Str "notes."] +,Div ("",["notes"],[]) + [Para [Str "The",Space,Str "second",Space,Str "note",Space,Str "div"]] +,HorizontalRule +,Para [Str "Strip",Space,Str "links",Space,Str "and",Space,Str "footnotes."] +,Div ("",["notes"],[]) + [Para [Str "No",Space,Link ("",[],[]) [Str "link"] ("https://www.google.com",""),Space,Str "here."] + ,Para [Str "No",Space,Str "note",Space,Str "here.",Note [Para [Str "You\8217ll",Space,Str "never",Space,Str "read",Space,Str "this"]]]]] diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx new file mode 100644 index 000000000..f95df9622 Binary files /dev/null and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx new file mode 100644 index 000000000..0ab1302da Binary files /dev/null and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx new file mode 100644 index 000000000..930377fbf Binary files /dev/null and b/test/pptx/speaker-notes/templated.pptx differ diff --git a/test/pptx/speaker_notes.native b/test/pptx/speaker_notes.native deleted file mode 100644 index 4eeca2107..000000000 --- a/test/pptx/speaker_notes.native +++ /dev/null @@ -1,17 +0,0 @@ -[Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "slide."] -,Div ("",["notes"],[]) - [Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "note."] - ,Para [Str "Here",Space,Str "is",Space,Emph [Str "some"],Space,Strong [Str "other"],Space,Str "formatting."]] -,HorizontalRule -,Para [Str "A",Space,Str "page",Space,Str "with",Space,Str "no",Space,Str "speaker",Space,Str "notes"] -,HorizontalRule -,Div ("",["notes"],[]) - [Para [Str "The",Space,Str "first",Space,Str "note",Space,Str "div"]] -,Para [Str "A",Space,Str "page",Space,Str "with",Space,Str "two",Space,Str "notes."] -,Div ("",["notes"],[]) - [Para [Str "The",Space,Str "second",Space,Str "note",Space,Str "div"]] -,HorizontalRule -,Para [Str "Strip",Space,Str "links",Space,Str "and",Space,Str "footnotes."] -,Div ("",["notes"],[]) - [Para [Str "No",Space,Link ("",[],[]) [Str "link"] ("https://www.google.com",""),Space,Str "here."] - ,Para [Str "No",Space,Str "note",Space,Str "here.",Note [Para [Str "You\8217ll",Space,Str "never",Space,Str "read",Space,Str "this"]]]]] diff --git a/test/pptx/speaker_notes.pptx b/test/pptx/speaker_notes.pptx deleted file mode 100644 index 0ab1302da..000000000 Binary files a/test/pptx/speaker_notes.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_after_metadata.native b/test/pptx/speaker_notes_after_metadata.native deleted file mode 100644 index 6fda4b1ab..000000000 --- a/test/pptx/speaker_notes_after_metadata.native +++ /dev/null @@ -1,5 +0,0 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaInlines [Str "Jesse",Space,Str "Rosenthal"]),("title",MetaInlines [Str "Testing"])]}) -[Div ("",["notes"],[]) - [Para [Str "Some",Space,Str "speaker",Space,Str "notes"]] -,Header 1 ("a-header",[],[]) [Str "A",Space,Str "header"] -,Para [Str "And",Space,Str "a",Space,Str "new",Space,Str "slide."]] diff --git a/test/pptx/speaker_notes_after_metadata.pptx b/test/pptx/speaker_notes_after_metadata.pptx deleted file mode 100644 index 6343bffe4..000000000 Binary files a/test/pptx/speaker_notes_after_metadata.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx b/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx deleted file mode 100644 index 1298870e2..000000000 Binary files a/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx b/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx deleted file mode 100644 index b844a0b51..000000000 Binary files a/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_after_metadata_templated.pptx b/test/pptx/speaker_notes_after_metadata_templated.pptx deleted file mode 100644 index 8d27c4c68..000000000 Binary files a/test/pptx/speaker_notes_after_metadata_templated.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterheader.native b/test/pptx/speaker_notes_afterheader.native deleted file mode 100644 index 0f7dd95d7..000000000 --- a/test/pptx/speaker_notes_afterheader.native +++ /dev/null @@ -1,3 +0,0 @@ -[Header 1 ("here-is-a-single-header",[],[]) [Str "Here",Space,Str "is",Space,Str "a",Space,Str "single",Space,Str "header"] -,Div ("",["notes"],[]) - [Para [Str "and",Space,Str "here",Space,Str "are",Space,Str "some",Space,Str "notes"]]] diff --git a/test/pptx/speaker_notes_afterheader.pptx b/test/pptx/speaker_notes_afterheader.pptx deleted file mode 100644 index d581681aa..000000000 Binary files a/test/pptx/speaker_notes_afterheader.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx b/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx deleted file mode 100644 index 853b918cb..000000000 Binary files a/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterheader_moved_layouts.pptx b/test/pptx/speaker_notes_afterheader_moved_layouts.pptx deleted file mode 100644 index 9fff9f855..000000000 Binary files a/test/pptx/speaker_notes_afterheader_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterheader_templated.pptx b/test/pptx/speaker_notes_afterheader_templated.pptx deleted file mode 100644 index d8d8481df..000000000 Binary files a/test/pptx/speaker_notes_afterheader_templated.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterseps.native b/test/pptx/speaker_notes_afterseps.native deleted file mode 100644 index 4fd7b1ccb..000000000 --- a/test/pptx/speaker_notes_afterseps.native +++ /dev/null @@ -1,63 +0,0 @@ -[Para [Image ("",[],[]) [Str "The",Space,Str "moon"] ("lalune.jpg","fig:")] -,Div ("",["notes"],[]) - [Para [Str "chicken",Space,Str "and",Space,Str "dumplings"]] -,Table ("",[],[]) (Caption Nothing - [Para [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax,",Space,Str "with",Space,Str "alignment"]]) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Div ("",["notes"],[]) - [Para [Str "foo",Space,Str "bar"]] -,Div ("",["columns"],[]) - [Div ("",["column"],[]) - [BulletList - [[Para [Str "some",Space,Str "stuff"]] - ,[Para [Str "some",Space,Str "more",Space,Str "stuff"]]] - ,Div ("",["notes"],[]) - [Para [Str "Some",Space,Str "notes",Space,Str "inside",Space,Str "a",Space,Str "column"]]] - ,Div ("",["column"],[]) - [Para [Str "Some",Space,Str "other",Space,Emph [Str "stuff"]]]] -,Div ("",["notes"],[]) - [Para [Str "Some",Space,Str "notes",Space,Str "outside",Space,Str "the",Space,Str "column"]]] \ No newline at end of file diff --git a/test/pptx/speaker_notes_afterseps.pptx b/test/pptx/speaker_notes_afterseps.pptx deleted file mode 100644 index 9542fe8b5..000000000 Binary files a/test/pptx/speaker_notes_afterseps.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx b/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx deleted file mode 100644 index 9fec1c279..000000000 Binary files a/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterseps_moved_layouts.pptx b/test/pptx/speaker_notes_afterseps_moved_layouts.pptx deleted file mode 100644 index de697cbd8..000000000 Binary files a/test/pptx/speaker_notes_afterseps_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterseps_templated.pptx b/test/pptx/speaker_notes_afterseps_templated.pptx deleted file mode 100644 index 5a3d15d57..000000000 Binary files a/test/pptx/speaker_notes_afterseps_templated.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_deleted_layouts.pptx b/test/pptx/speaker_notes_deleted_layouts.pptx deleted file mode 100644 index 6a5ad524f..000000000 Binary files a/test/pptx/speaker_notes_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_moved_layouts.pptx b/test/pptx/speaker_notes_moved_layouts.pptx deleted file mode 100644 index f95df9622..000000000 Binary files a/test/pptx/speaker_notes_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_templated.pptx b/test/pptx/speaker_notes_templated.pptx deleted file mode 100644 index 930377fbf..000000000 Binary files a/test/pptx/speaker_notes_templated.pptx and /dev/null differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx new file mode 100644 index 000000000..d9cf91804 Binary files /dev/null and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/input.native b/test/pptx/start-numbering-at/input.native new file mode 100644 index 000000000..ecffbb0ef --- /dev/null +++ b/test/pptx/start-numbering-at/input.native @@ -0,0 +1,9 @@ +[Header 2 ("example-numbering-mwe",[],[]) [Str "Example",Space,Str "numbering",Space,Str "MWE"] +,Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "slide",Space,Str "with",Space,Str "examples",Space,Str "in",Space,Str "(1)",Space,Str "and",Space,Str "(2)"] +,OrderedList (1,Example,TwoParens) + [[Plain [Str "First"]] + ,[Plain [Str "Second"]]] +,Header 2 ("a-second-slide",[],[]) [Str "A",Space,Str "second",Space,Str "slide"] +,Para [Str "This",Space,Str "second",Space,Str "slide",Space,Str "has",Space,Str "a",Space,Str "third",Space,Str "example",Space,Str "in",Space,Str "(3)."] +,OrderedList (3,Example,TwoParens) + [[Plain [Str "Third"]]]] diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx new file mode 100644 index 000000000..e1b2d4de8 Binary files /dev/null and b/test/pptx/start-numbering-at/moved-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx new file mode 100644 index 000000000..4320128b3 Binary files /dev/null and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx new file mode 100644 index 000000000..efc56ac7a Binary files /dev/null and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/start_numbering_at.native b/test/pptx/start_numbering_at.native deleted file mode 100644 index ecffbb0ef..000000000 --- a/test/pptx/start_numbering_at.native +++ /dev/null @@ -1,9 +0,0 @@ -[Header 2 ("example-numbering-mwe",[],[]) [Str "Example",Space,Str "numbering",Space,Str "MWE"] -,Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "slide",Space,Str "with",Space,Str "examples",Space,Str "in",Space,Str "(1)",Space,Str "and",Space,Str "(2)"] -,OrderedList (1,Example,TwoParens) - [[Plain [Str "First"]] - ,[Plain [Str "Second"]]] -,Header 2 ("a-second-slide",[],[]) [Str "A",Space,Str "second",Space,Str "slide"] -,Para [Str "This",Space,Str "second",Space,Str "slide",Space,Str "has",Space,Str "a",Space,Str "third",Space,Str "example",Space,Str "in",Space,Str "(3)."] -,OrderedList (3,Example,TwoParens) - [[Plain [Str "Third"]]]] diff --git a/test/pptx/start_numbering_at.pptx b/test/pptx/start_numbering_at.pptx deleted file mode 100644 index 4320128b3..000000000 Binary files a/test/pptx/start_numbering_at.pptx and /dev/null differ diff --git a/test/pptx/start_numbering_at_deleted_layouts.pptx b/test/pptx/start_numbering_at_deleted_layouts.pptx deleted file mode 100644 index d9cf91804..000000000 Binary files a/test/pptx/start_numbering_at_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/start_numbering_at_moved_layouts.pptx b/test/pptx/start_numbering_at_moved_layouts.pptx deleted file mode 100644 index e1b2d4de8..000000000 Binary files a/test/pptx/start_numbering_at_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/start_numbering_at_templated.pptx b/test/pptx/start_numbering_at_templated.pptx deleted file mode 100644 index efc56ac7a..000000000 Binary files a/test/pptx/start_numbering_at_templated.pptx and /dev/null differ diff --git a/test/pptx/tables.native b/test/pptx/tables.native deleted file mode 100644 index 27b843f2b..000000000 --- a/test/pptx/tables.native +++ /dev/null @@ -1,95 +0,0 @@ -[Header 2 ("a-table-with-a-caption",[],[]) [Str "A",Space,Str "Table,",Space,Str "with",Space,Str "a",Space,Str "caption"] -,Table ("",[],[]) (Caption Nothing - [Para [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax,",Space,Str "with",Space,Str "alignment"]]) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - [])] \ No newline at end of file diff --git a/test/pptx/tables.pptx b/test/pptx/tables.pptx deleted file mode 100644 index e41219844..000000000 Binary files a/test/pptx/tables.pptx and /dev/null differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx new file mode 100644 index 000000000..a52222551 Binary files /dev/null and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/tables/input.native b/test/pptx/tables/input.native new file mode 100644 index 000000000..27b843f2b --- /dev/null +++ b/test/pptx/tables/input.native @@ -0,0 +1,95 @@ +[Header 2 ("a-table-with-a-caption",[],[]) [Str "A",Space,Str "Table,",Space,Str "with",Space,Str "a",Space,Str "caption"] +,Table ("",[],[]) (Caption Nothing + [Para [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax,",Space,Str "with",Space,Str "alignment"]]) + [(AlignRight,ColWidthDefault) + ,(AlignLeft,ColWidthDefault) + ,(AlignCenter,ColWidthDefault) + ,(AlignDefault,ColWidthDefault)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Right"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Left"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Center"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Default"]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + []) +,Table ("",[],[]) (Caption Nothing + []) + [(AlignRight,ColWidthDefault) + ,(AlignLeft,ColWidthDefault) + ,(AlignCenter,ColWidthDefault) + ,(AlignDefault,ColWidthDefault)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Right"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Left"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Center"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Default"]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + [])] \ No newline at end of file diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx new file mode 100644 index 000000000..56608a039 Binary files /dev/null and b/test/pptx/tables/moved-layouts.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx new file mode 100644 index 000000000..e41219844 Binary files /dev/null and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/tables/templated.pptx b/test/pptx/tables/templated.pptx new file mode 100644 index 000000000..0a8c3e8d9 Binary files /dev/null and b/test/pptx/tables/templated.pptx differ diff --git a/test/pptx/tables_deleted_layouts.pptx b/test/pptx/tables_deleted_layouts.pptx deleted file mode 100644 index a52222551..000000000 Binary files a/test/pptx/tables_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/tables_moved_layouts.pptx b/test/pptx/tables_moved_layouts.pptx deleted file mode 100644 index 56608a039..000000000 Binary files a/test/pptx/tables_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/tables_templated.pptx b/test/pptx/tables_templated.pptx deleted file mode 100644 index 0a8c3e8d9..000000000 Binary files a/test/pptx/tables_templated.pptx and /dev/null differ diff --git a/test/pptx/two-column/deleted-layouts.pptx b/test/pptx/two-column/deleted-layouts.pptx new file mode 100644 index 000000000..60a244f94 Binary files /dev/null and b/test/pptx/two-column/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/input.native b/test/pptx/two-column/input.native new file mode 100644 index 000000000..086f74889 --- /dev/null +++ b/test/pptx/two-column/input.native @@ -0,0 +1,9 @@ +Pandoc (Meta {unMeta = fromList []}) +[Header 1 ("two-column-layout",[],[]) [Str "Two-Column",Space,Str "Layout"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "One",Space,Str "paragraph."] + ,Para [Str "Another",Space,Str "paragraph."]] + ,Div ("",["column"],[]) + [Para [Str "Second",Space,Str "column",Space,Str "paragraph."] + ,Para [Str "Another",Space,Str "second",Space,Str "paragraph."]]]] diff --git a/test/pptx/two-column/moved-layouts.pptx b/test/pptx/two-column/moved-layouts.pptx new file mode 100644 index 000000000..a17f96b18 Binary files /dev/null and b/test/pptx/two-column/moved-layouts.pptx differ diff --git a/test/pptx/two-column/output.pptx b/test/pptx/two-column/output.pptx new file mode 100644 index 000000000..270a7eeac Binary files /dev/null and b/test/pptx/two-column/output.pptx differ diff --git a/test/pptx/two-column/templated.pptx b/test/pptx/two-column/templated.pptx new file mode 100644 index 000000000..6d9470372 Binary files /dev/null and b/test/pptx/two-column/templated.pptx differ diff --git a/test/pptx/two_column.native b/test/pptx/two_column.native deleted file mode 100644 index 086f74889..000000000 --- a/test/pptx/two_column.native +++ /dev/null @@ -1,9 +0,0 @@ -Pandoc (Meta {unMeta = fromList []}) -[Header 1 ("two-column-layout",[],[]) [Str "Two-Column",Space,Str "Layout"] -,Div ("",["columns"],[]) - [Div ("",["column"],[]) - [Para [Str "One",Space,Str "paragraph."] - ,Para [Str "Another",Space,Str "paragraph."]] - ,Div ("",["column"],[]) - [Para [Str "Second",Space,Str "column",Space,Str "paragraph."] - ,Para [Str "Another",Space,Str "second",Space,Str "paragraph."]]]] diff --git a/test/pptx/two_column.pptx b/test/pptx/two_column.pptx deleted file mode 100644 index 270a7eeac..000000000 Binary files a/test/pptx/two_column.pptx and /dev/null differ diff --git a/test/pptx/two_column_deleted_layouts.pptx b/test/pptx/two_column_deleted_layouts.pptx deleted file mode 100644 index 60a244f94..000000000 Binary files a/test/pptx/two_column_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/two_column_moved_layouts.pptx b/test/pptx/two_column_moved_layouts.pptx deleted file mode 100644 index a17f96b18..000000000 Binary files a/test/pptx/two_column_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/two_column_templated.pptx b/test/pptx/two_column_templated.pptx deleted file mode 100644 index 6d9470372..000000000 Binary files a/test/pptx/two_column_templated.pptx and /dev/null differ -- cgit v1.2.3 From b82a01b6883c1f6a9ce5d3edd80d5a2453ecef9e Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 19 Aug 2021 15:53:21 +0100 Subject: pptx: Add support for more layouts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now, the pptx writer only supported four slide layouts: “Title Slide” (used for the automatically generated metadata slide), “Section Header” (used for headings above the slide level), “Two Column” (used when there’s a columns div containing at least two column divs), and “Title and Content” (used for all other slides). This commit adds support for three more layouts: Comparison, Content with Caption, and Blank. - Support “Comparison” slide layout This layout is used when a slide contains at least two columns, at least one of which contains some text followed by some non-text (e.g. an image or table). The text in each column is inserted into the “body” placeholder for that column, and the non-text is inserted into the ObjType placeholder. Any extra content after the non-text is overlaid on top of the preceding content, rather than dropping it completely (as currently happens for the two-column layout). + Accept straightforward test changes Adding the new layout means the “-deleted-layouts” tests have an additional layout added to the master and master rels. + Add new tests for the comparison layout + Add new tests to pandoc.cabal - Support “Content with Caption” slide layout This layout is used when a slide’s body contains some text, followed by non-text (e.g. and image or a table). Before now, in this case the image or table would break onto a new slide: to get that output again, users can add a horizontal rule before the image or table. + Accept straightforward tests The “-deleted-layouts” tests all have an extra layout and relationship in the master for the Content with Caption layout. + Accept remove-empty-slides test Empty slides are still removed, but the Content with Caption layout is now used. + Change slide-level-0/h1-h2-with-text description This test now triggers the content with caption layout, giving a different (but still correct) result. + Add new tests for the new layout + Add new tests to the cabal file - Support “Blank” slide layout This layout is used when a slide contains only blank content (e.g. non-breaking spaces). No content is inserted into any placeholders in the layout. Fixes #5097. + Accept straightforward test changes Blank layout now copied over from reference doc as well, when layouts have been deleted. + Add some new tests A slide should use the blank layout if: - It contains only speaker notes - It contains only an empty heading with a body of nbsps - It contains only a heading containing only nbsps - Change ContentType -> Placeholder This type was starting to have a constructor for each placeholder on each slide (e.g. `ComparisonUpperLeftContent`). I’ve changed it instead to identify a placeholder by type and index, as I think that’s clearer and less redundant. - Describe layout-choosing logic in manual --- MANUAL.txt | 52 +++++- pandoc.cabal | 30 +++- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 179 ++++++++++++++++--- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 189 +++++++++++++++++---- test/Tests/Writers/Powerpoint.hs | 61 ++++++- .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 0 -> 35181 bytes test/pptx/blanks/just-speaker-notes/input.native | 7 + .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 0 -> 45873 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 0 -> 32304 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 0 -> 45369 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 0 -> 30444 bytes test/pptx/blanks/nbsp-in-body/input.native | 6 + test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 0 -> 41131 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 0 -> 27562 bytes test/pptx/blanks/nbsp-in-body/templated.pptx | Bin 0 -> 40630 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 0 -> 30444 bytes test/pptx/blanks/nbsp-in-heading/input.native | 5 + .../pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 0 -> 41131 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 0 -> 27562 bytes test/pptx/blanks/nbsp-in-heading/templated.pptx | Bin 0 -> 40630 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 31033 -> 31069 bytes test/pptx/code/deleted-layouts.pptx | Bin 31032 -> 31068 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 0 -> 45804 bytes test/pptx/comparison/both-columns/input.native | 23 +++ .../comparison/both-columns/moved-layouts.pptx | Bin 0 -> 56524 bytes test/pptx/comparison/both-columns/output.pptx | Bin 0 -> 42932 bytes test/pptx/comparison/both-columns/templated.pptx | Bin 0 -> 56025 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 0 -> 45833 bytes test/pptx/comparison/extra-image/input.native | 24 +++ .../pptx/comparison/extra-image/moved-layouts.pptx | Bin 0 -> 56552 bytes test/pptx/comparison/extra-image/output.pptx | Bin 0 -> 42961 bytes test/pptx/comparison/extra-image/templated.pptx | Bin 0 -> 56053 bytes .../comparison/extra-text/deleted-layouts.pptx | Bin 0 -> 45804 bytes test/pptx/comparison/extra-text/input.native | 23 +++ test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 0 -> 56524 bytes test/pptx/comparison/extra-text/output.pptx | Bin 0 -> 42932 bytes test/pptx/comparison/extra-text/templated.pptx | Bin 0 -> 56025 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 0 -> 45717 bytes test/pptx/comparison/non-text-first/input.native | 21 +++ .../comparison/non-text-first/moved-layouts.pptx | Bin 0 -> 56417 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 0 -> 42845 bytes test/pptx/comparison/non-text-first/templated.pptx | Bin 0 -> 55918 bytes .../comparison/one-column/deleted-layouts.pptx | Bin 0 -> 29136 bytes test/pptx/comparison/one-column/input.native | 21 +++ test/pptx/comparison/one-column/moved-layouts.pptx | Bin 0 -> 39856 bytes test/pptx/comparison/one-column/output.pptx | Bin 0 -> 26258 bytes test/pptx/comparison/one-column/templated.pptx | Bin 0 -> 39357 bytes .../heading-text-image/deleted-layouts.pptx | Bin 0 -> 45549 bytes .../heading-text-image/input.native | 3 + .../heading-text-image/moved-layouts.pptx | Bin 0 -> 56248 bytes .../heading-text-image/output.pptx | Bin 0 -> 42677 bytes .../heading-text-image/templated.pptx | Bin 0 -> 55749 bytes .../image-text/deleted-layouts.pptx | Bin 0 -> 46248 bytes .../content-with-caption/image-text/input.native | 2 + .../image-text/moved-layouts.pptx | Bin 0 -> 56934 bytes .../content-with-caption/image-text/output.pptx | Bin 0 -> 43374 bytes .../content-with-caption/image-text/templated.pptx | Bin 0 -> 56435 bytes .../text-image/deleted-layouts.pptx | Bin 0 -> 45488 bytes .../content-with-caption/text-image/input.native | 2 + .../text-image/moved-layouts.pptx | Bin 0 -> 56188 bytes .../content-with-caption/text-image/output.pptx | Bin 0 -> 42616 bytes .../content-with-caption/text-image/templated.pptx | Bin 0 -> 55689 bytes .../deleted-layouts.pptx | Bin 29806 -> 29842 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 30210 -> 30246 bytes test/pptx/endnotes-toc/deleted-layouts.pptx | Bin 30596 -> 30632 bytes test/pptx/endnotes/deleted-layouts.pptx | Bin 29774 -> 29810 bytes test/pptx/images/deleted-layouts.pptx | Bin 47437 -> 47473 bytes test/pptx/inline-formatting/deleted-layouts.pptx | Bin 28966 -> 29002 bytes test/pptx/lists/deleted-layouts.pptx | Bin 29861 -> 29897 bytes test/pptx/raw-ooxml/deleted-layouts.pptx | Bin 29754 -> 29790 bytes test/pptx/remove-empty-slides/deleted-layouts.pptx | Bin 46867 -> 46218 bytes test/pptx/remove-empty-slides/moved-layouts.pptx | Bin 57656 -> 56903 bytes test/pptx/remove-empty-slides/output.pptx | Bin 44025 -> 43346 bytes test/pptx/remove-empty-slides/templated.pptx | Bin 57172 -> 56404 bytes .../deleted-layouts.pptx | Bin 30554 -> 30590 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 32328 -> 32364 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 31378 -> 31414 bytes .../h1-h2-with-table/deleted-layouts.pptx | Bin 29828 -> 29137 bytes .../h1-h2-with-table/moved-layouts.pptx | Bin 40552 -> 39829 bytes .../slide-level-0/h1-h2-with-table/output.pptx | Bin 26985 -> 26259 bytes .../slide-level-0/h1-h2-with-table/templated.pptx | Bin 40052 -> 39330 bytes .../h1-with-image/deleted-layouts.pptx | Bin 45433 -> 45469 bytes .../h1-with-table/deleted-layouts.pptx | Bin 29008 -> 29044 bytes .../h2-with-image/deleted-layouts.pptx | Bin 45433 -> 45469 bytes .../deleted-layouts.pptx | Bin 34473 -> 34509 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33500 -> 33536 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54396 -> 54432 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38203 -> 38239 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 29837 -> 29873 bytes test/pptx/tables/deleted-layouts.pptx | Bin 30381 -> 30417 bytes test/pptx/two-column/deleted-layouts.pptx | Bin 28883 -> 28919 bytes 91 files changed, 580 insertions(+), 68 deletions(-) create mode 100644 test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx create mode 100644 test/pptx/blanks/just-speaker-notes/input.native create mode 100644 test/pptx/blanks/just-speaker-notes/moved-layouts.pptx create mode 100644 test/pptx/blanks/just-speaker-notes/output.pptx create mode 100644 test/pptx/blanks/just-speaker-notes/templated.pptx create mode 100644 test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx create mode 100644 test/pptx/blanks/nbsp-in-body/input.native create mode 100644 test/pptx/blanks/nbsp-in-body/moved-layouts.pptx create mode 100644 test/pptx/blanks/nbsp-in-body/output.pptx create mode 100644 test/pptx/blanks/nbsp-in-body/templated.pptx create mode 100644 test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx create mode 100644 test/pptx/blanks/nbsp-in-heading/input.native create mode 100644 test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx create mode 100644 test/pptx/blanks/nbsp-in-heading/output.pptx create mode 100644 test/pptx/blanks/nbsp-in-heading/templated.pptx create mode 100644 test/pptx/comparison/both-columns/deleted-layouts.pptx create mode 100644 test/pptx/comparison/both-columns/input.native create mode 100644 test/pptx/comparison/both-columns/moved-layouts.pptx create mode 100644 test/pptx/comparison/both-columns/output.pptx create mode 100644 test/pptx/comparison/both-columns/templated.pptx create mode 100644 test/pptx/comparison/extra-image/deleted-layouts.pptx create mode 100644 test/pptx/comparison/extra-image/input.native create mode 100644 test/pptx/comparison/extra-image/moved-layouts.pptx create mode 100644 test/pptx/comparison/extra-image/output.pptx create mode 100644 test/pptx/comparison/extra-image/templated.pptx create mode 100644 test/pptx/comparison/extra-text/deleted-layouts.pptx create mode 100644 test/pptx/comparison/extra-text/input.native create mode 100644 test/pptx/comparison/extra-text/moved-layouts.pptx create mode 100644 test/pptx/comparison/extra-text/output.pptx create mode 100644 test/pptx/comparison/extra-text/templated.pptx create mode 100644 test/pptx/comparison/non-text-first/deleted-layouts.pptx create mode 100644 test/pptx/comparison/non-text-first/input.native create mode 100644 test/pptx/comparison/non-text-first/moved-layouts.pptx create mode 100644 test/pptx/comparison/non-text-first/output.pptx create mode 100644 test/pptx/comparison/non-text-first/templated.pptx create mode 100644 test/pptx/comparison/one-column/deleted-layouts.pptx create mode 100644 test/pptx/comparison/one-column/input.native create mode 100644 test/pptx/comparison/one-column/moved-layouts.pptx create mode 100644 test/pptx/comparison/one-column/output.pptx create mode 100644 test/pptx/comparison/one-column/templated.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/input.native create mode 100644 test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/output.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/templated.pptx create mode 100644 test/pptx/content-with-caption/image-text/deleted-layouts.pptx create mode 100644 test/pptx/content-with-caption/image-text/input.native create mode 100644 test/pptx/content-with-caption/image-text/moved-layouts.pptx create mode 100644 test/pptx/content-with-caption/image-text/output.pptx create mode 100644 test/pptx/content-with-caption/image-text/templated.pptx create mode 100644 test/pptx/content-with-caption/text-image/deleted-layouts.pptx create mode 100644 test/pptx/content-with-caption/text-image/input.native create mode 100644 test/pptx/content-with-caption/text-image/moved-layouts.pptx create mode 100644 test/pptx/content-with-caption/text-image/output.pptx create mode 100644 test/pptx/content-with-caption/text-image/templated.pptx (limited to 'test/pptx') diff --git a/MANUAL.txt b/MANUAL.txt index f81f4c70b..afdd66ddd 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1182,11 +1182,15 @@ header when requesting a document from a URL: - Title and Content - Section Header - Two Content + - Comparison + - Content with Caption + - Blank For each name, the first layout found with that name will be used. If no layout is found with one of the names, pandoc will output a warning and use the layout with that name from the default reference - doc instead. + doc instead. (How these layouts are used is described in [PowerPoint + layout choice](#powerpoint-layout-choice).) All templates included with a recent version of MS PowerPoint will fit these criteria. (You can click on `Layout` under the @@ -1195,8 +1199,8 @@ header when requesting a document from a URL: You can also modify the default `reference.pptx`: first run `pandoc -o custom-reference.pptx --print-default-data-file reference.pptx`, and then modify `custom-reference.pptx` - in MS PowerPoint (pandoc will use the first four layout - slides, as mentioned above). + in MS PowerPoint (pandoc will use the layouts with the names + listed above). `--epub-cover-image=`*FILE* @@ -5833,6 +5837,48 @@ you use deeper nesting of section levels with reveal.js unless you set `--slide-level=0` (which lets reveal.js produce a one-dimensional layout and only interprets horizontal rules as slide boundaries). +### PowerPoint layout choice + +When creating slides, the pptx writer chooses from a number of pre-defined +layouts, based on the content of the slide: + +Title Slide +: This layout is used for the initial slide, which is generated and + filled from the metadata fields `date`, `author`, and `title`, if + they are present. + +Section Header +: This layout is used for what pandoc calls “title slides”, i.e. + slides which start with a header which is above the slide level in + the hierarchy. + +Two Content +: This layout is used for two-column slides, i.e. slides containing a + div with class `columns` which contains at least two divs with class + `column`. + +Comparison +: This layout is used instead of “Two Content” for any two-column + slides in which at least one column contains text followed by + non-text (e.g. an image or a table). + +Content with Caption +: This layout is used for any non-two-column slides which contain text + followed by non-text (e.g. an image or a table). + +Blank +: This layout is used for any slides which only contain blank content, + e.g. a slide containing only speaker notes, or a slide containing + only a non-breaking space. + +Title and Content +: This layout is used for all slides which do not match the criteria + for another layout. + +These layouts are chosen from the default pptx reference doc included with +pandoc, unless an alternative reference doc is specified using +`--reference-doc`. + ## Incremental lists By default, these writers produce lists that display "all at once." diff --git a/pandoc.cabal b/pandoc.cabal index 7fb951488..3de7da39c 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -380,17 +380,31 @@ extra-source-files: test/rtf/*.native test/rtf/*.rtf test/pptx/*.pptx + test/pptx/blanks/just-speaker-notes/input.native + test/pptx/blanks/just-speaker-notes/*.pptx + test/pptx/blanks/nbsp-in-body/input.native + test/pptx/blanks/nbsp-in-body/*.pptx + test/pptx/blanks/nbsp-in-heading/input.native + test/pptx/blanks/nbsp-in-heading/*.pptx test/pptx/code-custom/*.pptx test/pptx/code/input.native test/pptx/code/*.pptx - test/pptx/comparison-both-columns/input.native - test/pptx/comparison-both-columns/*.pptx - test/pptx/comparison-extra-text/input.native - test/pptx/comparison-extra-text/*.pptx - test/pptx/comparison-non-text-first/input.native - test/pptx/comparison-non-text-first/*.pptx - test/pptx/comparison-one-column/input.native - test/pptx/comparison-one-column/*.pptx + test/pptx/content-with-caption/heading-text-image/input.native + test/pptx/content-with-caption/heading-text-image/*.pptx + test/pptx/content-with-caption/image-text/input.native + test/pptx/content-with-caption/image-text/*.pptx + test/pptx/content-with-caption/text-image/input.native + test/pptx/content-with-caption/text-image/*.pptx + test/pptx/comparison/both-columns/input.native + test/pptx/comparison/both-columns/*.pptx + test/pptx/comparison/extra-image/input.native + test/pptx/comparison/extra-image/*.pptx + test/pptx/comparison/extra-text/input.native + test/pptx/comparison/extra-text/*.pptx + test/pptx/comparison/non-text-first/input.native + test/pptx/comparison/non-text-first/*.pptx + test/pptx/comparison/one-column/input.native + test/pptx/comparison/one-column/*.pptx test/pptx/document-properties-short-desc/input.native test/pptx/document-properties-short-desc/*.pptx test/pptx/document-properties/input.native diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 0e6a67861..d83fb2182 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -1,6 +1,7 @@ {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} +{-# LANGUAGE RecordWildCards #-} {- | Module : Text.Pandoc.Writers.Powerpoint.Output Copyright : Copyright (C) 2017-2020 Jesse Rosenthal @@ -115,7 +116,7 @@ data WriterEnv = WriterEnv { envRefArchive :: Archive -- the end of the slide file name and -- the rId number , envSlideIdOffset :: Int - , envContentType :: ContentType + , envPlaceholder :: Placeholder , envSlideIdMap :: M.Map SlideId Int -- maps the slide number to the -- corresponding notes id number. If there @@ -139,7 +140,7 @@ instance Default WriterEnv where , envInNoteSlide = False , envCurSlideId = 1 , envSlideIdOffset = 1 - , envContentType = NormalContent + , envPlaceholder = Placeholder ObjType 0 , envSlideIdMap = mempty , envSpeakerNotesIdMap = mempty , envInSpeakerNotes = False @@ -153,6 +154,9 @@ data SlideLayoutsOf a = SlideLayouts , title :: a , content :: a , twoColumn :: a + , comparison :: a + , contentWithCaption :: a + , blank :: a } deriving (Show, Functor, Foldable, Traversable) data SlideLayout = SlideLayout @@ -170,10 +174,14 @@ getSlideLayouts = asks envSlideLayouts >>= maybe (throwError e) pure e = PandocSomeError ("Slide layouts aren't defined, even though they should " <> "always be. This is a bug in pandoc.") -data ContentType = NormalContent - | TwoColumnLeftContent - | TwoColumnRightContent - deriving (Show, Eq) +-- | A placeholder within a layout, identified by type and index. +-- +-- E.g., @Placeholder ObjType 2@ is the third placeholder of type 'ObjType' in +-- the layout. +data Placeholder = Placeholder + { placeholderType :: PHType + , index :: Int + } deriving (Show, Eq) data MediaInfo = MediaInfo { mInfoFilePath :: FilePath , mInfoLocalId :: Int @@ -446,6 +454,9 @@ presentationToArchive opts meta pres = do , title = "Section Header" , content = "Title and Content" , twoColumn = "Two Content" + , comparison = "Comparison" + , contentWithCaption = "Content with Caption" + , blank = "Blank" } layouts <- for layoutTitles $ \layoutTitle -> do let layout = M.lookup (CI.mk layoutTitle) referenceLayouts @@ -550,10 +561,13 @@ getLayout layout = getElement <$> getSlideLayouts where getElement = slElement . case layout of - MetadataSlide{} -> metadata - TitleSlide{} -> title - ContentSlide{} -> content - TwoColumnSlide{} -> twoColumn + MetadataSlide{} -> metadata + TitleSlide{} -> title + ContentSlide{} -> content + TwoColumnSlide{} -> twoColumn + ComparisonSlide{} -> comparison + ContentWithCaptionSlide{} -> contentWithCaption + BlankSlide{} -> blank shapeHasId :: NameSpaces -> T.Text -> Element -> Bool shapeHasId ns ident element @@ -566,17 +580,31 @@ shapeHasId ns ident element getContentShape :: PandocMonad m => NameSpaces -> Element -> P m Element getContentShape ns spTreeElem | isElem ns "p" "spTree" spTreeElem = do - contentType <- asks envContentType - let contentShapes = getShapesByPlaceHolderType ns spTreeElem ObjType - case contentType of - NormalContent | (sp : _) <- contentShapes -> return sp - TwoColumnLeftContent | (sp : _) <- contentShapes -> return sp - TwoColumnRightContent | (_ : sp : _) <- contentShapes -> return sp - _ -> throwError $ PandocSomeError - "Could not find shape for Powerpoint content" + ph@Placeholder{..} <- asks envPlaceholder + case drop index (getShapesByPlaceHolderType ns spTreeElem placeholderType) of + sp : _ -> return sp + [] -> throwError $ PandocSomeError $ missingPlaceholderMessage ph getContentShape _ _ = throwError $ PandocSomeError "Attempted to find content on non shapeTree" +missingPlaceholderMessage :: Placeholder -> Text +missingPlaceholderMessage Placeholder{..} = + "Could not find a " <> ordinal + <> " placeholder of type " <> placeholderText + where + ordinal = T.pack (show index) <> + case (index `mod` 100, index `mod` 10) of + (11, _) -> "th" + (12, _) -> "th" + (13, _) -> "th" + (_, 1) -> "st" + (_, 2) -> "nd" + (_, 3) -> "rd" + _ -> "th" + placeholderText = case placeholderType of + ObjType -> "obj (or nothing)" + PHType t -> t + getShapeDimensions :: NameSpaces -> Element -> Maybe ((Integer, Integer), (Integer, Integer)) @@ -1302,7 +1330,7 @@ contentToElement layout hdrShape shapes element <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] contentElements <- local - (\env -> env {envContentType = NormalContent}) + (\env -> env {envPlaceholder = Placeholder ObjType 0}) (shapesToElements layout shapes) return $ buildSpTree ns spTree (hdrShapeElements <> contentElements) contentToElement _ _ _ = return $ mknode "p:sp" [] () @@ -1315,10 +1343,10 @@ twoColumnToElement layout hdrShape shapesL shapesR element <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] contentElementsL <- local - (\env -> env {envContentType =TwoColumnLeftContent}) + (\env -> env {envPlaceholder = Placeholder ObjType 0}) (shapesToElements layout shapesL) contentElementsR <- local - (\env -> env {envContentType =TwoColumnRightContent}) + (\env -> env {envPlaceholder = Placeholder ObjType 1}) (shapesToElements layout shapesR) -- let contentElementsL' = map (setIdx ns "1") contentElementsL -- contentElementsR' = map (setIdx ns "2") contentElementsR @@ -1326,6 +1354,76 @@ twoColumnToElement layout hdrShape shapesL shapesR hdrShapeElements <> contentElementsL <> contentElementsR twoColumnToElement _ _ _ _= return $ mknode "p:sp" [] () +comparisonToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + ([Shape], [Shape]) -> + ([Shape], [Shape]) -> + P m Element +comparisonToElement layout hdrShape (shapesL1, shapesL2) (shapesR1, shapesR2) + | ns <- elemToNameSpaces layout + , Just cSld <- findChild (elemName ns "p" "cSld") layout + , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do + element <- nonBodyTextToElement layout [PHType "title"] hdrShape + let hdrShapeElements = [Elem element | not (null hdrShape)] + contentElementsL1 <- local + (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) + (shapesToElements layout shapesL1) + contentElementsL2 <- local + (\env -> env {envPlaceholder = Placeholder ObjType 0}) + (shapesToElements layout shapesL2) + contentElementsR1 <- local + (\env -> env {envPlaceholder = Placeholder (PHType "body") 1}) + (shapesToElements layout shapesR1) + contentElementsR2 <- local + (\env -> env {envPlaceholder = Placeholder ObjType 1}) + (shapesToElements layout shapesR2) + return $ buildSpTree ns spTree $ + mconcat [ hdrShapeElements + , contentElementsL1 + , contentElementsL2 + , contentElementsR1 + , contentElementsR2 + ] +comparisonToElement _ _ _ _= return $ mknode "p:sp" [] () + +contentWithCaptionToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + [Shape] -> + [Shape] -> + P m Element +contentWithCaptionToElement layout hdrShape textShapes contentShapes + | ns <- elemToNameSpaces layout + , Just cSld <- findChild (elemName ns "p" "cSld") layout + , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do + element <- nonBodyTextToElement layout [PHType "title"] hdrShape + let hdrShapeElements = [Elem element | not (null hdrShape)] + textElements <- local + (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) + (shapesToElements layout textShapes) + contentElements <- local + (\env -> env {envPlaceholder = Placeholder ObjType 0}) + (shapesToElements layout contentShapes) + return $ buildSpTree ns spTree $ + mconcat [ hdrShapeElements + , textElements + , contentElements + ] +contentWithCaptionToElement _ _ _ _ = return $ mknode "p:sp" [] () + +blankToElement :: + PandocMonad m => + Element -> + P m Element +blankToElement layout + | ns <- elemToNameSpaces layout + , Just cSld <- findChild (elemName ns "p" "cSld") layout + , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do + return $ buildSpTree ns spTree [] +blankToElement _ = return $ mknode "p:sp" [] () titleToElement :: PandocMonad m => Element -> [ParaElem] -> P m Element titleToElement layout titleElems @@ -1380,6 +1478,17 @@ slideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _) = do ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") ] [mknode "p:cSld" [] [spTree]] +slideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _) = do + layout <- getLayout l + spTree <- local (\env -> if null hdrElems + then env + else env{envSlideHasHeader=True}) $ + comparisonToElement layout hdrElems shapesL shapesR + return $ mknode "p:sld" + [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), + ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), + ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") + ] [mknode "p:cSld" [] [spTree]] slideToElement (Slide _ l@(TitleSlide hdrElems) _) = do layout <- getLayout l spTree <- titleToElement layout hdrElems @@ -1396,7 +1505,22 @@ slideToElement (Slide _ l@(MetadataSlide titleElems subtitleElems authorElems da ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") ] [mknode "p:cSld" [] [spTree]] - +slideToElement (Slide _ l@(ContentWithCaptionSlide hdrElems captionShapes contentShapes) _) = do + layout <- getLayout l + spTree <- contentWithCaptionToElement layout hdrElems captionShapes contentShapes + return $ mknode "p:sld" + [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), + ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), + ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") + ] [mknode "p:cSld" [] [spTree]] +slideToElement (Slide _ BlankSlide _) = do + layout <- getLayout BlankSlide + spTree <- blankToElement layout + return $ mknode "p:sld" + [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), + ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), + ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") + ] [mknode "p:cSld" [] [spTree]] -------------------------------------------------------------------- -- Notes: @@ -1800,10 +1924,13 @@ slideToSlideRelElement slide = do target <- flip fmap getSlideLayouts $ T.pack . ("../slideLayouts/" <>) . takeFileName . slPath . case slide of - (Slide _ MetadataSlide{} _) -> metadata - (Slide _ TitleSlide{} _) -> title - (Slide _ ContentSlide{} _) -> content - (Slide _ TwoColumnSlide{} _) -> twoColumn + (Slide _ MetadataSlide{} _) -> metadata + (Slide _ TitleSlide{} _) -> title + (Slide _ ContentSlide{} _) -> content + (Slide _ TwoColumnSlide{} _) -> twoColumn + (Slide _ ComparisonSlide{} _) -> comparison + (Slide _ ContentWithCaptionSlide{} _) -> contentWithCaption + (Slide _ BlankSlide _) -> blank speakerNotesRels <- maybeToList <$> speakerNotesSlideRelElement slide diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 284b9ae62..10060d975 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -2,6 +2,7 @@ {-# LANGUAGE PatternGuards #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE LambdaCase #-} {- | Module : Text.Pandoc.Writers.Powerpoint.Presentation Copyright : Copyright (C) 2017-2020 Jesse Rosenthal @@ -61,11 +62,13 @@ import Text.Pandoc.Writers.Shared (lookupMetaInlines, lookupMetaBlocks , toLegacyTable) import qualified Data.Map as M import qualified Data.Set as S -import Data.Maybe (maybeToList, fromMaybe) +import Data.Maybe (maybeToList, fromMaybe, listToMaybe) import Text.Pandoc.Highlighting import qualified Data.Text as T import Control.Applicative ((<|>)) import Skylighting +import Data.Bifunctor (bimap) +import Data.Char (isSpace) data WriterEnv = WriterEnv { envMetadata :: Meta , envRunProps :: RunProps @@ -195,6 +198,11 @@ data Layout = MetadataSlide [ParaElem] [ParaElem] [[ParaElem]] [ParaElem] -- heading content | TwoColumnSlide [ParaElem] [Shape] [Shape] -- heading left right + | ComparisonSlide [ParaElem] ([Shape], [Shape]) ([Shape], [Shape]) + -- heading left@(text, content) right@(text, content) + | ContentWithCaptionSlide [ParaElem] [Shape] [Shape] + -- heading text content + | BlankSlide deriving (Show, Eq) data Shape = Pic PicProps FilePath T.Text [ParaElem] @@ -584,7 +592,30 @@ isImage Image{} = True isImage (Link _ (Image{} : _) _) = True isImage _ = False -splitBlocks' :: [Block] -> [[Block]] -> [Block] -> Pres [[Block]] +plainOrPara :: Block -> Maybe [Inline] +plainOrPara (Plain ils) = Just ils +plainOrPara (Para ils) = Just ils +plainOrPara _ = Nothing + +notText :: Block -> Bool +notText block | startsWithImage block = True +notText Table{} = True +notText _ = False + +startsWithImage :: Block -> Bool +startsWithImage block = fromMaybe False $ do + inline <- plainOrPara block >>= listToMaybe + pure (isImage inline) + +-- | Group blocks into a number of "splits" +splitBlocks' :: + -- | Blocks so far in the current split + [Block] -> + -- | Splits so far + [[Block]] -> + -- | All remaining blocks + [Block] -> + Pres [[Block]] splitBlocks' cur acc [] = return $ acc ++ ([cur | not (null cur)]) splitBlocks' cur acc (HorizontalRule : blks) = splitBlocks' [] (acc ++ ([cur | not (null cur)])) blks @@ -609,7 +640,9 @@ splitBlocks' cur acc (Para (il:ils) : blks) | isImage il = do (acc ++ [cur ++ [Para [il]] ++ nts]) (if null ils then blks' else Para ils : blks') _ -> splitBlocks' [] - (acc ++ ([cur | not (null cur)]) ++ [Para [il] : nts]) + (if any notText cur + then acc ++ ([cur | not (null cur)]) ++ [Para [il] : nts] + else acc ++ [cur ++ [Para [il]] ++ nts]) (if null ils then blks' else Para ils : blks') splitBlocks' cur acc (tbl@Table{} : blks) = do slideLevel <- asks envSlideLevel @@ -617,7 +650,11 @@ splitBlocks' cur acc (tbl@Table{} : blks) = do case cur of [Header n _ _] | n == slideLevel || slideLevel == 0 -> splitBlocks' [] (acc ++ [cur ++ [tbl] ++ nts]) blks' - _ -> splitBlocks' [] (acc ++ ([cur | not (null cur)]) ++ [tbl : nts]) blks' + _ -> splitBlocks' [] + (if any notText cur + then acc ++ ([cur | not (null cur)]) ++ [tbl : nts] + else acc ++ ([cur ++ [tbl] ++ nts])) + blks' splitBlocks' cur acc (d@(Div (_, classes, _) _): blks) | "columns" `elem` classes = do slideLevel <- asks envSlideLevel let (nts, blks') = span isNotesDiv blks @@ -639,38 +676,56 @@ bodyBlocksToSlide _ (blk : blks) spkNotes , Div (_, clsL, _) blksL : Div (_, clsR, _) blksR : remaining <- divBlks , "column" `elem` clsL, "column" `elem` clsR = do mapM_ (addLogMessage . BlockNotRendered) (blks ++ remaining) - mbSplitBlksL <- splitBlocks blksL - mbSplitBlksR <- splitBlocks blksR - let blksL' = case mbSplitBlksL of - bs : _ -> bs - [] -> [] - let blksR' = case mbSplitBlksR of - bs : _ -> bs - [] -> [] - shapesL <- blocksToShapes blksL' - shapesR <- blocksToShapes blksR' - sldId <- asks envCurSlideId - return $ Slide - sldId - (TwoColumnSlide [] shapesL shapesR) - spkNotes + let mkTwoColumn left right = do + blksL' <- join . take 1 <$> splitBlocks left + blksR' <- join . take 1 <$> splitBlocks right + shapesL <- blocksToShapes blksL' + shapesR <- blocksToShapes blksR' + sldId <- asks envCurSlideId + return $ Slide + sldId + (TwoColumnSlide [] shapesL shapesR) + spkNotes + let mkComparison blksL1 blksL2 blksR1 blksR2 = do + shapesL1 <- blocksToShapes blksL1 + shapesL2 <- blocksToShapes blksL2 + shapesR1 <- blocksToShapes blksR1 + shapesR2 <- blocksToShapes blksR2 + sldId <- asks envCurSlideId + return $ Slide + sldId + (ComparisonSlide [] (shapesL1, shapesL2) (shapesR1, shapesR2)) + spkNotes + case (break notText blksL, break notText blksR) of + ((_, []), (_, [])) -> mkTwoColumn blksL blksR + (([], _), ([], _)) -> mkTwoColumn blksL blksR + ((blksL1, blksL2), (blksR1, blksR2)) -> mkComparison blksL1 blksL2 blksR1 blksR2 bodyBlocksToSlide _ (blk : blks) spkNotes = do - inNoteSlide <- asks envInNoteSlide - shapes <- if inNoteSlide - then forceFontSize noteSize $ blocksToShapes (blk : blks) - else blocksToShapes (blk : blks) sldId <- asks envCurSlideId - return $ - Slide - sldId - (ContentSlide [] shapes) - spkNotes + inNoteSlide <- asks envInNoteSlide + let mkSlide s = + Slide sldId s spkNotes + if inNoteSlide + then mkSlide . ContentSlide [] <$> + forceFontSize noteSize (blocksToShapes (blk : blks)) + else let + contentOrBlankSlide = + if makesBlankSlide (blk : blks) + then pure (mkSlide BlankSlide) + else mkSlide . ContentSlide [] <$> blocksToShapes (blk : blks) + in case break notText (blk : blks) of + ([], _) -> contentOrBlankSlide + (_, []) -> contentOrBlankSlide + (textBlocks, contentBlocks) -> do + textShapes <- blocksToShapes textBlocks + contentShapes <- blocksToShapes contentBlocks + return (mkSlide (ContentWithCaptionSlide [] textShapes contentShapes)) bodyBlocksToSlide _ [] spkNotes = do sldId <- asks envCurSlideId return $ Slide sldId - (ContentSlide [] []) + BlankSlide spkNotes blocksToSlide' :: Int -> [Block] -> SpeakerNotes -> Pres Slide @@ -689,6 +744,9 @@ blocksToSlide' lvl (Header n (ident, _, _) ils : blks) spkNotes let layout = case slideLayout slide of ContentSlide _ cont -> ContentSlide hdr cont TwoColumnSlide _ contL contR -> TwoColumnSlide hdr contL contR + ComparisonSlide _ contL contR -> ComparisonSlide hdr contL contR + ContentWithCaptionSlide _ text content -> ContentWithCaptionSlide hdr text content + BlankSlide -> if all inlineIsBlank ils then BlankSlide else ContentSlide hdr [] layout' -> layout' return $ slide{slideLayout = layout} blocksToSlide' lvl blks spkNotes = bodyBlocksToSlide lvl blks spkNotes @@ -834,6 +892,19 @@ applyToLayout f (TwoColumnSlide hdr contentL contentR) = do contentL' <- mapM (applyToShape f) contentL contentR' <- mapM (applyToShape f) contentR return $ TwoColumnSlide hdr' contentL' contentR' +applyToLayout f (ComparisonSlide hdr (contentL1, contentL2) (contentR1, contentR2)) = do + hdr' <- mapM f hdr + contentL1' <- mapM (applyToShape f) contentL1 + contentL2' <- mapM (applyToShape f) contentL2 + contentR1' <- mapM (applyToShape f) contentR1 + contentR2' <- mapM (applyToShape f) contentR2 + return $ ComparisonSlide hdr' (contentL1', contentL2') (contentR1', contentR2') +applyToLayout f (ContentWithCaptionSlide hdr textShapes contentShapes) = do + hdr' <- mapM f hdr + textShapes' <- mapM (applyToShape f) textShapes + contentShapes' <- mapM (applyToShape f) contentShapes + return $ ContentWithCaptionSlide hdr' textShapes' contentShapes' +applyToLayout _ BlankSlide = pure BlankSlide applyToSlide :: Monad m => (ParaElem -> m ParaElem) -> Slide -> m Slide applyToSlide f slide = do @@ -885,10 +956,70 @@ emptyLayout layout = case layout of all emptyParaElem hdr && all emptyShape shapes1 && all emptyShape shapes2 + ComparisonSlide hdr (shapesL1, shapesL2) (shapesR1, shapesR2) -> + all emptyParaElem hdr && + all emptyShape shapesL1 && + all emptyShape shapesL2 && + all emptyShape shapesR1 && + all emptyShape shapesR2 + ContentWithCaptionSlide hdr textShapes contentShapes -> + all emptyParaElem hdr && + all emptyShape textShapes && + all emptyShape contentShapes + BlankSlide -> False + emptySlide :: Slide -> Bool emptySlide (Slide _ layout notes) = (notes == mempty) && emptyLayout layout +makesBlankSlide :: [Block] -> Bool +makesBlankSlide = all blockIsBlank + +blockIsBlank :: Block -> Bool +blockIsBlank + = \case + Plain ins -> all inlineIsBlank ins + Para ins -> all inlineIsBlank ins + LineBlock inss -> all (all inlineIsBlank) inss + CodeBlock _ txt -> textIsBlank txt + RawBlock _ txt -> textIsBlank txt + BlockQuote bls -> all blockIsBlank bls + OrderedList _ blss -> all (all blockIsBlank) blss + BulletList blss -> all (all blockIsBlank) blss + DefinitionList ds -> all (uncurry (&&) . bimap (all inlineIsBlank) (all (all blockIsBlank))) ds + Header _ _ ils -> all inlineIsBlank ils + HorizontalRule -> True + Table{} -> False + Div _ bls -> all blockIsBlank bls + Null -> True + +textIsBlank :: T.Text -> Bool +textIsBlank = T.all isSpace + +inlineIsBlank :: Inline -> Bool +inlineIsBlank + = \case + (Str txt) -> textIsBlank txt + (Emph ins) -> all inlineIsBlank ins + (Underline ins) -> all inlineIsBlank ins + (Strong ins) -> all inlineIsBlank ins + (Strikeout ins) -> all inlineIsBlank ins + (Superscript ins) -> all inlineIsBlank ins + (Subscript ins) -> all inlineIsBlank ins + (SmallCaps ins) -> all inlineIsBlank ins + (Quoted _ ins) -> all inlineIsBlank ins + (Cite _ _) -> False + (Code _ txt) -> textIsBlank txt + Space -> True + SoftBreak -> True + LineBreak -> True + (Math _ txt) -> textIsBlank txt + (RawInline _ txt) -> textIsBlank txt + (Link _ ins (t1, t2)) -> all inlineIsBlank ins && textIsBlank t1 && textIsBlank t2 + (Image _ ins (t1, t2)) -> all inlineIsBlank ins && textIsBlank t1 && textIsBlank t2 + (Note bls) -> all blockIsBlank bls + (Span _ ins) -> all inlineIsBlank ins + blocksToPresentationSlides :: [Block] -> Pres [Slide] blocksToPresentationSlides blks = do opts <- asks envOpts diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index fd9871659..256ee1f7f 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -166,9 +166,66 @@ tests = groupPptxTests [ pptxTests "Inline formatting" "pptx/slide-level-0/h1-with-table/output.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)") + <> "slide title (content with caption layout)") def { writerSlideLevel = Just 0 } "pptx/slide-level-0/h1-h2-with-table/input.native" "pptx/slide-level-0/h1-h2-with-table/output.pptx" + , pptxTests ("comparison layout used when two columns " + <> "contain text plus non-text") + def + "pptx/comparison/both-columns/input.native" + "pptx/comparison/both-columns/output.pptx" + , pptxTests ("comparison layout used even when only one " + <> "column contains text plus non-text") + def + "pptx/comparison/one-column/input.native" + "pptx/comparison/one-column/output.pptx" + , pptxTests ("extra text in one column in comparison " + <> "layout gets overlaid") + def + "pptx/comparison/extra-text/input.native" + "pptx/comparison/extra-text/output.pptx" + , pptxTests ("extra image in one column in comparison " + <> "layout gets overlaid") + def + "pptx/comparison/extra-image/input.native" + "pptx/comparison/extra-image/output.pptx" + , pptxTests "comparison not used if the non-text comes first" + def + "pptx/comparison/non-text-first/input.native" + "pptx/comparison/non-text-first/output.pptx" + , pptxTests ("Heading, text and an image on the same " + <> "slide uses the Content with Caption " + <> "layout") + def + "pptx/content-with-caption/heading-text-image/input.native" + "pptx/content-with-caption/heading-text-image/output.pptx" + , pptxTests ("Text and an image on the same " + <> "slide uses the Content with Caption " + <> "layout") + def + "pptx/content-with-caption/text-image/input.native" + "pptx/content-with-caption/text-image/output.pptx" + , pptxTests ("If the image comes first, Content with " + <> "Caption is not used") + def + "pptx/content-with-caption/image-text/input.native" + "pptx/content-with-caption/image-text/output.pptx" + , pptxTests ("If a slide contains only speaker notes, the " + <> "Blank layout is used") + def + "pptx/blanks/just-speaker-notes/input.native" + "pptx/blanks/just-speaker-notes/output.pptx" + , pptxTests ("If a slide contains only an empty heading " + <> "with a body of only non-breaking spaces" + <> ", the Blank layout is used") + def + "pptx/blanks/nbsp-in-body/input.native" + "pptx/blanks/nbsp-in-body/output.pptx" + , pptxTests ("If a slide contains only a heading " + <> "containing only non-breaking spaces, " + <> "the Blank layout is used") + def + "pptx/blanks/nbsp-in-heading/input.native" + "pptx/blanks/nbsp-in-heading/output.pptx" ] diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx new file mode 100644 index 000000000..82800a074 Binary files /dev/null and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/input.native b/test/pptx/blanks/just-speaker-notes/input.native new file mode 100644 index 000000000..d2e2cfbe2 --- /dev/null +++ b/test/pptx/blanks/just-speaker-notes/input.native @@ -0,0 +1,7 @@ +[Header 1 ("first-slide",[],[]) [Str "First",Space,Str "slide"] +,Para [Str "Nothing",Space,Str "to",Space,Str "see",Space,Str "here"] +,Header 1 ("section",[],[]) [] +,Div ("",["notes"],[]) + [Para [Str "Some",Space,Str "notes",Space,Str "here:",Space,Str "this",Space,Str "first",Space,Str "slide",Space,Str "should",Space,Str "use",Space,Str "the",Space,Str "Blank",Space,Str "template"]] +,Header 1 ("third-slide",[],[]) [Str "Third",Space,Str "slide"] +,Para [Str "The",Space,Str "second",Space,Str "slide",Space,Str "should",Space,Str "be",Space,Str "blank"]] diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx new file mode 100644 index 000000000..f5ef1d7bd Binary files /dev/null and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx new file mode 100644 index 000000000..59a643c3e Binary files /dev/null and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx new file mode 100644 index 000000000..8cc7be75b Binary files /dev/null and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx new file mode 100644 index 000000000..98a1586df Binary files /dev/null and b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/input.native b/test/pptx/blanks/nbsp-in-body/input.native new file mode 100644 index 000000000..56c105fb0 --- /dev/null +++ b/test/pptx/blanks/nbsp-in-body/input.native @@ -0,0 +1,6 @@ +[Header 1 ("first-slide",[],[]) [Str "First",Space,Str "slide"] +,Para [Str "Uninteresting,",Space,Str "normal"] +,Header 1 ("section",[],[]) [] +,Para [Str "\160"] +,Header 1 ("third-slide",[],[]) [Str "Third",Space,Str "slide"] +,Para [Str "Was",Space,Str "the",Space,Str "previous",Space,Str "one",Space,Str "blank?"]] diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx new file mode 100644 index 000000000..fca99b672 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx new file mode 100644 index 000000000..ed5c77e05 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/templated.pptx b/test/pptx/blanks/nbsp-in-body/templated.pptx new file mode 100644 index 000000000..4104f6230 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-body/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx new file mode 100644 index 000000000..98a1586df Binary files /dev/null and b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/input.native b/test/pptx/blanks/nbsp-in-heading/input.native new file mode 100644 index 000000000..a5c7fc1ca --- /dev/null +++ b/test/pptx/blanks/nbsp-in-heading/input.native @@ -0,0 +1,5 @@ +[Header 1 ("first-slide",[],[]) [Str "First",Space,Str "slide"] +,Para [Str "Uninteresting,",Space,Str "normal"] +,Header 1 ("section",[],[]) [Str "\160"] +,Header 1 ("third-slide",[],[]) [Str "Third",Space,Str "slide"] +,Para [Str "Was",Space,Str "the",Space,Str "previous",Space,Str "one",Space,Str "blank?"]] diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx new file mode 100644 index 000000000..fca99b672 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx new file mode 100644 index 000000000..ed5c77e05 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/templated.pptx b/test/pptx/blanks/nbsp-in-heading/templated.pptx new file mode 100644 index 000000000..4104f6230 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-heading/templated.pptx differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx index 9282e6354..fdcc7ce1d 100644 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx index 0f503f553..c7f78ac40 100644 Binary files a/test/pptx/code/deleted-layouts.pptx and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx new file mode 100644 index 000000000..6a5affdbf Binary files /dev/null and b/test/pptx/comparison/both-columns/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/input.native b/test/pptx/comparison/both-columns/input.native new file mode 100644 index 000000000..2557880d4 --- /dev/null +++ b/test/pptx/comparison/both-columns/input.native @@ -0,0 +1,23 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Then",Space,Str "some",Space,Str "more",Space,Str "text"]] + ,Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Para [Image ("",[],[]) [Str "Plus",Space,Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx new file mode 100644 index 000000000..88282fabb Binary files /dev/null and b/test/pptx/comparison/both-columns/moved-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx new file mode 100644 index 000000000..477072fb4 Binary files /dev/null and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx new file mode 100644 index 000000000..431d22392 Binary files /dev/null and b/test/pptx/comparison/both-columns/templated.pptx differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx new file mode 100644 index 000000000..beed077f7 Binary files /dev/null and b/test/pptx/comparison/extra-image/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/input.native b/test/pptx/comparison/extra-image/input.native new file mode 100644 index 000000000..34aeb8f2b --- /dev/null +++ b/test/pptx/comparison/extra-image/input.native @@ -0,0 +1,24 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Then",Space,Str "some",Space,Str "more",Space,Str "text"]] + ,Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Para [Image ("",[],[]) [Str "Plus",Space,Str "an",Space,Str "image"] ("lalune.jpg","fig:")] + ,Para [Image ("",[],[]) [Str "And",Space,Str "another",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx new file mode 100644 index 000000000..f86f5b043 Binary files /dev/null and b/test/pptx/comparison/extra-image/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx new file mode 100644 index 000000000..a0eb5e847 Binary files /dev/null and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx new file mode 100644 index 000000000..a434ba29f Binary files /dev/null and b/test/pptx/comparison/extra-image/templated.pptx differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx new file mode 100644 index 000000000..6a5affdbf Binary files /dev/null and b/test/pptx/comparison/extra-text/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/input.native b/test/pptx/comparison/extra-text/input.native new file mode 100644 index 000000000..2557880d4 --- /dev/null +++ b/test/pptx/comparison/extra-text/input.native @@ -0,0 +1,23 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Then",Space,Str "some",Space,Str "more",Space,Str "text"]] + ,Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Para [Image ("",[],[]) [Str "Plus",Space,Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx new file mode 100644 index 000000000..88282fabb Binary files /dev/null and b/test/pptx/comparison/extra-text/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx new file mode 100644 index 000000000..8de7d23b2 Binary files /dev/null and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx new file mode 100644 index 000000000..431d22392 Binary files /dev/null and b/test/pptx/comparison/extra-text/templated.pptx differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx new file mode 100644 index 000000000..bd7aa69b7 Binary files /dev/null and b/test/pptx/comparison/non-text-first/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/input.native b/test/pptx/comparison/non-text-first/input.native new file mode 100644 index 000000000..a8caad151 --- /dev/null +++ b/test/pptx/comparison/non-text-first/input.native @@ -0,0 +1,21 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Plus",Space,Str "a",Space,Str "paragraph",Space,Str "here"]] + ,Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "Just",Space,Str "an",Space,Str "image",Space,Str "on",Space,Str "this",Space,Str "side"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx new file mode 100644 index 000000000..a01def95c Binary files /dev/null and b/test/pptx/comparison/non-text-first/moved-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx new file mode 100644 index 000000000..cb7843fce Binary files /dev/null and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx new file mode 100644 index 000000000..32db19cbf Binary files /dev/null and b/test/pptx/comparison/non-text-first/templated.pptx differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx new file mode 100644 index 000000000..5fd7cf9b6 Binary files /dev/null and b/test/pptx/comparison/one-column/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/input.native b/test/pptx/comparison/one-column/input.native new file mode 100644 index 000000000..b99740a14 --- /dev/null +++ b/test/pptx/comparison/one-column/input.native @@ -0,0 +1,21 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + [])] + ,Div ("",["column"],[]) + [Para [Str "Only",Space,Str "a",Space,Str "paragraph",Space,Str "here"]]]] diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx new file mode 100644 index 000000000..d5df2b751 Binary files /dev/null and b/test/pptx/comparison/one-column/moved-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx new file mode 100644 index 000000000..6914162ff Binary files /dev/null and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx new file mode 100644 index 000000000..a30a24453 Binary files /dev/null and b/test/pptx/comparison/one-column/templated.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx new file mode 100644 index 000000000..b5afcc021 Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/input.native b/test/pptx/content-with-caption/heading-text-image/input.native new file mode 100644 index 000000000..576bc1658 --- /dev/null +++ b/test/pptx/content-with-caption/heading-text-image/input.native @@ -0,0 +1,3 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Para [Str "Some",Space,Str "text",Space,Str "here"] +,Para [Image ("",[],[]) [Str "Followed",Space,Str "by",Space,Str "a",Space,Str "picture"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx new file mode 100644 index 000000000..05806a767 Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx new file mode 100644 index 000000000..b3e89757b Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx new file mode 100644 index 000000000..3b0fe64c3 Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx new file mode 100644 index 000000000..e9e0551ac Binary files /dev/null and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/input.native b/test/pptx/content-with-caption/image-text/input.native new file mode 100644 index 000000000..2ffbf0888 --- /dev/null +++ b/test/pptx/content-with-caption/image-text/input.native @@ -0,0 +1,2 @@ +[Para [Image ("",[],[]) [Str "The",Space,Str "picture",Space,Str "first"] ("lalune.jpg","fig:")] +,Para [Str "Then",Space,Str "some",Space,Str "text",Space,Str "here"]] diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx new file mode 100644 index 000000000..77d706ed3 Binary files /dev/null and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx new file mode 100644 index 000000000..94a2e8b88 Binary files /dev/null and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx new file mode 100644 index 000000000..bef1921a7 Binary files /dev/null and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx new file mode 100644 index 000000000..68d3d7b9b Binary files /dev/null and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/input.native b/test/pptx/content-with-caption/text-image/input.native new file mode 100644 index 000000000..762d18426 --- /dev/null +++ b/test/pptx/content-with-caption/text-image/input.native @@ -0,0 +1,2 @@ +[Para [Str "Some",Space,Str "text",Space,Str "here"] +,Para [Image ("",[],[]) [Str "Followed",Space,Str "by",Space,Str "a",Space,Str "picture"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx new file mode 100644 index 000000000..feade1096 Binary files /dev/null and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx new file mode 100644 index 000000000..efa814d65 Binary files /dev/null and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx new file mode 100644 index 000000000..ebd552252 Binary files /dev/null and b/test/pptx/content-with-caption/text-image/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx index e4cf6bd7b..a866f3c1f 100644 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx index a00c8059d..1f52481f3 100644 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes-toc/deleted-layouts.pptx b/test/pptx/endnotes-toc/deleted-layouts.pptx index 46708544c..60110a64e 100644 Binary files a/test/pptx/endnotes-toc/deleted-layouts.pptx and b/test/pptx/endnotes-toc/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes/deleted-layouts.pptx b/test/pptx/endnotes/deleted-layouts.pptx index 5c69a6310..0b0bd2f53 100644 Binary files a/test/pptx/endnotes/deleted-layouts.pptx and b/test/pptx/endnotes/deleted-layouts.pptx differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx index 053928863..2f8754e90 100644 Binary files a/test/pptx/images/deleted-layouts.pptx and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/inline-formatting/deleted-layouts.pptx b/test/pptx/inline-formatting/deleted-layouts.pptx index bbd5bfeb4..2fbe21a45 100644 Binary files a/test/pptx/inline-formatting/deleted-layouts.pptx and b/test/pptx/inline-formatting/deleted-layouts.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx index 6512e44bb..e527d3c5f 100644 Binary files a/test/pptx/lists/deleted-layouts.pptx and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/raw-ooxml/deleted-layouts.pptx b/test/pptx/raw-ooxml/deleted-layouts.pptx index 2ea155657..2da1b7a63 100644 Binary files a/test/pptx/raw-ooxml/deleted-layouts.pptx and b/test/pptx/raw-ooxml/deleted-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/deleted-layouts.pptx b/test/pptx/remove-empty-slides/deleted-layouts.pptx index 7ae4a5fab..51981b241 100644 Binary files a/test/pptx/remove-empty-slides/deleted-layouts.pptx and b/test/pptx/remove-empty-slides/deleted-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/moved-layouts.pptx b/test/pptx/remove-empty-slides/moved-layouts.pptx index 2572f2447..ddca32a52 100644 Binary files a/test/pptx/remove-empty-slides/moved-layouts.pptx and b/test/pptx/remove-empty-slides/moved-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/output.pptx b/test/pptx/remove-empty-slides/output.pptx index c6df8e18e..9e8b5eed2 100644 Binary files a/test/pptx/remove-empty-slides/output.pptx and b/test/pptx/remove-empty-slides/output.pptx differ diff --git a/test/pptx/remove-empty-slides/templated.pptx b/test/pptx/remove-empty-slides/templated.pptx index 1df48c5ad..579467452 100644 Binary files a/test/pptx/remove-empty-slides/templated.pptx and b/test/pptx/remove-empty-slides/templated.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx index 2c7fd4d8b..2c891cd1d 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx index 1e0b76d46..b63994cce 100644 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx index 86dfad3b2..fbf4054be 100644 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx index 5e776e05c..217b000b6 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx index 35204de1b..d8a6c90fe 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx index 197a6833f..512b324bf 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx index 5c659952e..5ab88e94c 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx index 16c61d1be..5be799e3b 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx index 0eb7c0b08..127dcea01 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx index afc096ce6..5be799e3b 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 1298870e2..33304ae3e 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 853b918cb..00f05fae5 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index 9fec1c279..139af783b 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index 6a5ad524f..c63125d8a 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx index d9cf91804..68b4215df 100644 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx index a52222551..d533d3c28 100644 Binary files a/test/pptx/tables/deleted-layouts.pptx and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/deleted-layouts.pptx b/test/pptx/two-column/deleted-layouts.pptx index 60a244f94..9622ed2cd 100644 Binary files a/test/pptx/two-column/deleted-layouts.pptx and b/test/pptx/two-column/deleted-layouts.pptx differ -- cgit v1.2.3 From 8ec9b884f1005e2935181045339614937159a0ad Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Wed, 1 Sep 2021 14:40:26 +0100 Subject: pptx: Fix capitalisation of notesMasterId MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I don’t think this has caused any problems, but before now it’s been "NotesMasterId", which is incorrect according to [ECMA-376]. [ECMA-376]: https://www.ecma-international.org/publications-and-standards/standards/ecma-376/ --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 2 +- .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35181 -> 35233 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45873 -> 45925 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32304 -> 32356 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 45369 -> 45421 bytes .../deleted-layouts.pptx | Bin 34509 -> 34561 bytes .../speaker-notes-after-metadata/moved-layouts.pptx | Bin 45269 -> 45321 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31636 -> 31688 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 44775 -> 44828 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33536 -> 33588 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44297 -> 44349 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30657 -> 30709 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 43803 -> 43855 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54432 -> 54484 bytes .../pptx/speaker-notes-afterseps/moved-layouts.pptx | Bin 65121 -> 65173 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51557 -> 51609 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64619 -> 64671 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38239 -> 38291 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 49002 -> 49054 bytes test/pptx/speaker-notes/output.pptx | Bin 35360 -> 35412 bytes test/pptx/speaker-notes/templated.pptx | Bin 48507 -> 48560 bytes 21 files changed, 1 insertion(+), 1 deletion(-) (limited to 'test/pptx') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index d83fb2182..a28eaf54c 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -1981,7 +1981,7 @@ presentationToPresentationElement pres@(Presentation _ slds) = do notesMasterElem = mknode "p:notesMasterIdLst" [] [ mknode - "p:NotesMasterId" + "p:notesMasterId" [("r:id", "rId" <> tshow notesMasterRId)] () ] diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx index 82800a074..100da7c7f 100644 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx index f5ef1d7bd..d142f045b 100644 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 59a643c3e..18f44c4cd 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx index 8cc7be75b..8beb704a4 100644 Binary files a/test/pptx/blanks/just-speaker-notes/templated.pptx and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 33304ae3e..48f75ae42 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx index b844a0b51..8f7aee710 100644 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index 6343bffe4..7fe3d3ae7 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx index 8d27c4c68..a9e883ada 100644 Binary files a/test/pptx/speaker-notes-after-metadata/templated.pptx and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 00f05fae5..831d37446 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx index 9fff9f855..7ba1c3a11 100644 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index d581681aa..bcb5dd214 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx index d8d8481df..010c4cce4 100644 Binary files a/test/pptx/speaker-notes-afterheader/templated.pptx and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index 139af783b..de607ae41 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx index de697cbd8..8eb81bee1 100644 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 9542fe8b5..4288b84b6 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index 5a3d15d57..96338a2b5 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index c63125d8a..558bb7930 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx index f95df9622..283170569 100644 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index 0ab1302da..f0e51e597 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx index 930377fbf..27df2d994 100644 Binary files a/test/pptx/speaker-notes/templated.pptx and b/test/pptx/speaker-notes/templated.pptx differ -- cgit v1.2.3 From 2b98991551a95f9f91fd6b643f52bf6065f5057a Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 2 Sep 2021 16:56:40 +0100 Subject: pptx: Include all themes in output archive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Accept test changes: they’re adding the second theme (for all tests not containing speaker notes), or changing its position in the XML (for the ones containing speaker notes). --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 6 ++---- .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35233 -> 35178 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45925 -> 45870 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32356 -> 32297 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 45421 -> 45365 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 30444 -> 32092 bytes test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 41131 -> 42780 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 27562 -> 29211 bytes test/pptx/blanks/nbsp-in-body/templated.pptx | Bin 40630 -> 42280 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 30444 -> 32092 bytes test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 41131 -> 42780 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 27562 -> 29211 bytes test/pptx/blanks/nbsp-in-heading/templated.pptx | Bin 40630 -> 42280 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 31069 -> 32717 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 41822 -> 43405 bytes test/pptx/code-custom/output.pptx | Bin 28184 -> 29836 bytes test/pptx/code-custom/templated.pptx | Bin 41337 -> 42905 bytes test/pptx/code/deleted-layouts.pptx | Bin 31068 -> 32716 bytes test/pptx/code/moved-layouts.pptx | Bin 41826 -> 43405 bytes test/pptx/code/output.pptx | Bin 28183 -> 29835 bytes test/pptx/code/templated.pptx | Bin 41337 -> 42905 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 45804 -> 47453 bytes .../pptx/comparison/both-columns/moved-layouts.pptx | Bin 56524 -> 58172 bytes test/pptx/comparison/both-columns/output.pptx | Bin 42932 -> 44581 bytes test/pptx/comparison/both-columns/templated.pptx | Bin 56025 -> 57674 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 45833 -> 47482 bytes test/pptx/comparison/extra-image/moved-layouts.pptx | Bin 56552 -> 58200 bytes test/pptx/comparison/extra-image/output.pptx | Bin 42961 -> 44610 bytes test/pptx/comparison/extra-image/templated.pptx | Bin 56053 -> 57702 bytes .../pptx/comparison/extra-text/deleted-layouts.pptx | Bin 45804 -> 47453 bytes test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 56524 -> 58172 bytes test/pptx/comparison/extra-text/output.pptx | Bin 42932 -> 44581 bytes test/pptx/comparison/extra-text/templated.pptx | Bin 56025 -> 57674 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 45717 -> 47366 bytes .../comparison/non-text-first/moved-layouts.pptx | Bin 56417 -> 58065 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 42845 -> 44494 bytes test/pptx/comparison/non-text-first/templated.pptx | Bin 55918 -> 57567 bytes .../pptx/comparison/one-column/deleted-layouts.pptx | Bin 29136 -> 30785 bytes test/pptx/comparison/one-column/moved-layouts.pptx | Bin 39856 -> 41506 bytes test/pptx/comparison/one-column/output.pptx | Bin 26258 -> 27906 bytes test/pptx/comparison/one-column/templated.pptx | Bin 39357 -> 41006 bytes .../heading-text-image/deleted-layouts.pptx | Bin 45549 -> 47198 bytes .../heading-text-image/moved-layouts.pptx | Bin 56248 -> 57896 bytes .../heading-text-image/output.pptx | Bin 42677 -> 44326 bytes .../heading-text-image/templated.pptx | Bin 55749 -> 57398 bytes .../image-text/deleted-layouts.pptx | Bin 46248 -> 47896 bytes .../image-text/moved-layouts.pptx | Bin 56934 -> 58584 bytes .../content-with-caption/image-text/output.pptx | Bin 43374 -> 45022 bytes .../content-with-caption/image-text/templated.pptx | Bin 56435 -> 58084 bytes .../text-image/deleted-layouts.pptx | Bin 45488 -> 47137 bytes .../text-image/moved-layouts.pptx | Bin 56188 -> 57836 bytes .../content-with-caption/text-image/output.pptx | Bin 42616 -> 44265 bytes .../content-with-caption/text-image/templated.pptx | Bin 55689 -> 57338 bytes .../deleted-layouts.pptx | Bin 29842 -> 31490 bytes .../moved-layouts.pptx | Bin 40600 -> 42178 bytes .../pptx/document-properties-short-desc/output.pptx | Bin 26967 -> 28619 bytes .../document-properties-short-desc/templated.pptx | Bin 40113 -> 41678 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 30246 -> 31894 bytes test/pptx/document-properties/moved-layouts.pptx | Bin 41004 -> 42582 bytes test/pptx/document-properties/output.pptx | Bin 27375 -> 29025 bytes test/pptx/document-properties/templated.pptx | Bin 40517 -> 42082 bytes test/pptx/endnotes-toc/deleted-layouts.pptx | Bin 30632 -> 32280 bytes test/pptx/endnotes-toc/moved-layouts.pptx | Bin 41384 -> 42967 bytes test/pptx/endnotes-toc/output.pptx | Bin 27747 -> 29399 bytes test/pptx/endnotes-toc/templated.pptx | Bin 40899 -> 42467 bytes test/pptx/endnotes/deleted-layouts.pptx | Bin 29810 -> 31458 bytes test/pptx/endnotes/moved-layouts.pptx | Bin 40566 -> 42146 bytes test/pptx/endnotes/output.pptx | Bin 26928 -> 28580 bytes test/pptx/endnotes/templated.pptx | Bin 40078 -> 41645 bytes test/pptx/images/deleted-layouts.pptx | Bin 47473 -> 49121 bytes test/pptx/images/moved-layouts.pptx | Bin 58160 -> 59809 bytes test/pptx/images/output.pptx | Bin 44596 -> 46244 bytes test/pptx/images/templated.pptx | Bin 57660 -> 59308 bytes test/pptx/inline-formatting/deleted-layouts.pptx | Bin 29002 -> 30651 bytes test/pptx/inline-formatting/moved-layouts.pptx | Bin 39758 -> 41339 bytes test/pptx/inline-formatting/output.pptx | Bin 26121 -> 27772 bytes test/pptx/inline-formatting/templated.pptx | Bin 39272 -> 40839 bytes test/pptx/lists/deleted-layouts.pptx | Bin 29897 -> 31545 bytes test/pptx/lists/moved-layouts.pptx | Bin 40653 -> 42233 bytes test/pptx/lists/output.pptx | Bin 27015 -> 28667 bytes test/pptx/lists/templated.pptx | Bin 40166 -> 41733 bytes test/pptx/raw-ooxml/deleted-layouts.pptx | Bin 29790 -> 31438 bytes test/pptx/raw-ooxml/moved-layouts.pptx | Bin 40546 -> 42126 bytes test/pptx/raw-ooxml/output.pptx | Bin 26908 -> 28560 bytes test/pptx/raw-ooxml/templated.pptx | Bin 40059 -> 41626 bytes test/pptx/remove-empty-slides/deleted-layouts.pptx | Bin 46218 -> 47866 bytes test/pptx/remove-empty-slides/moved-layouts.pptx | Bin 56903 -> 58553 bytes test/pptx/remove-empty-slides/output.pptx | Bin 43346 -> 44994 bytes test/pptx/remove-empty-slides/templated.pptx | Bin 56404 -> 58053 bytes .../slide-breaks-slide-level-1/deleted-layouts.pptx | Bin 30590 -> 32238 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 41343 -> 42926 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 27705 -> 29357 bytes test/pptx/slide-breaks-slide-level-1/templated.pptx | Bin 40858 -> 42426 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 32364 -> 34012 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 43118 -> 44701 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 29481 -> 31133 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 42634 -> 44201 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 31414 -> 33062 bytes test/pptx/slide-breaks/moved-layouts.pptx | Bin 42171 -> 43751 bytes test/pptx/slide-breaks/output.pptx | Bin 28531 -> 30183 bytes test/pptx/slide-breaks/templated.pptx | Bin 41683 -> 43250 bytes .../h1-h2-with-table/deleted-layouts.pptx | Bin 29137 -> 30786 bytes .../h1-h2-with-table/moved-layouts.pptx | Bin 39829 -> 41479 bytes .../pptx/slide-level-0/h1-h2-with-table/output.pptx | Bin 26259 -> 27907 bytes .../slide-level-0/h1-h2-with-table/templated.pptx | Bin 39330 -> 40979 bytes .../h1-with-image/deleted-layouts.pptx | Bin 45469 -> 47118 bytes .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 56156 -> 57804 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 42596 -> 44245 bytes .../pptx/slide-level-0/h1-with-image/templated.pptx | Bin 55657 -> 57306 bytes .../h1-with-table/deleted-layouts.pptx | Bin 29044 -> 30693 bytes .../slide-level-0/h1-with-table/moved-layouts.pptx | Bin 39731 -> 41381 bytes test/pptx/slide-level-0/h1-with-table/output.pptx | Bin 26166 -> 27814 bytes .../pptx/slide-level-0/h1-with-table/templated.pptx | Bin 39232 -> 40881 bytes .../h2-with-image/deleted-layouts.pptx | Bin 45469 -> 47118 bytes .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 56156 -> 57804 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 42596 -> 44245 bytes .../pptx/slide-level-0/h2-with-image/templated.pptx | Bin 55657 -> 57306 bytes .../deleted-layouts.pptx | Bin 34561 -> 34504 bytes .../speaker-notes-after-metadata/moved-layouts.pptx | Bin 45321 -> 45193 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31688 -> 31634 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 44828 -> 44690 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33588 -> 33532 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44349 -> 44220 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30709 -> 30653 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 43855 -> 43719 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54484 -> 54429 bytes .../pptx/speaker-notes-afterseps/moved-layouts.pptx | Bin 65173 -> 65119 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51609 -> 51548 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64671 -> 64614 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38291 -> 38236 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 49054 -> 48929 bytes test/pptx/speaker-notes/output.pptx | Bin 35412 -> 35358 bytes test/pptx/speaker-notes/templated.pptx | Bin 48560 -> 48423 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 29873 -> 31521 bytes test/pptx/start-numbering-at/moved-layouts.pptx | Bin 40630 -> 42209 bytes test/pptx/start-numbering-at/output.pptx | Bin 26991 -> 28643 bytes test/pptx/start-numbering-at/templated.pptx | Bin 40142 -> 41709 bytes test/pptx/tables/deleted-layouts.pptx | Bin 30417 -> 32065 bytes test/pptx/tables/moved-layouts.pptx | Bin 41174 -> 42753 bytes test/pptx/tables/output.pptx | Bin 27532 -> 29184 bytes test/pptx/tables/templated.pptx | Bin 40686 -> 42253 bytes test/pptx/two-column/deleted-layouts.pptx | Bin 28919 -> 30568 bytes test/pptx/two-column/moved-layouts.pptx | Bin 39676 -> 41256 bytes test/pptx/two-column/output.pptx | Bin 26038 -> 27689 bytes test/pptx/two-column/templated.pptx | Bin 39189 -> 40756 bytes 145 files changed, 2 insertions(+), 4 deletions(-) (limited to 'test/pptx') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 0b6ca50c2..43f94b247 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -239,8 +239,8 @@ alwaysInheritedPatterns = , "ppt/slideLayouts/_rels/slideLayout*.xml.rels" , "ppt/slideMasters/slideMaster1.xml" , "ppt/slideMasters/_rels/slideMaster1.xml.rels" - , "ppt/theme/theme1.xml" - , "ppt/theme/_rels/theme1.xml.rels" + , "ppt/theme/theme*.xml" + , "ppt/theme/_rels/theme*.xml.rels" , "ppt/presProps.xml" , "ppt/tableStyles.xml" , "ppt/media/image*" @@ -252,8 +252,6 @@ contingentInheritedPatterns pres = [] <> if presHasSpeakerNotes pres then map compile [ "ppt/notesMasters/notesMaster*.xml" , "ppt/notesMasters/_rels/notesMaster*.xml.rels" - , "ppt/theme/theme2.xml" - , "ppt/theme/_rels/theme2.xml.rels" ] else [] diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx index 100da7c7f..5038f2aaf 100644 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx index d142f045b..90353a560 100644 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 18f44c4cd..799c0f14a 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx index 8beb704a4..5e3afb5f8 100644 Binary files a/test/pptx/blanks/just-speaker-notes/templated.pptx and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx index 98a1586df..7716e1cbf 100644 Binary files a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx index fca99b672..3dc6c817e 100644 Binary files a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx index ed5c77e05..1df3f9574 100644 Binary files a/test/pptx/blanks/nbsp-in-body/output.pptx and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/templated.pptx b/test/pptx/blanks/nbsp-in-body/templated.pptx index 4104f6230..1cf58a1bb 100644 Binary files a/test/pptx/blanks/nbsp-in-body/templated.pptx and b/test/pptx/blanks/nbsp-in-body/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx index 98a1586df..7716e1cbf 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx index fca99b672..3dc6c817e 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx index ed5c77e05..e528091d7 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/output.pptx and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/templated.pptx b/test/pptx/blanks/nbsp-in-heading/templated.pptx index 4104f6230..1f2d91399 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/templated.pptx and b/test/pptx/blanks/nbsp-in-heading/templated.pptx differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx index fdcc7ce1d..b49cd4896 100644 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx index a14eeb6c8..c6806f37f 100644 Binary files a/test/pptx/code-custom/moved-layouts.pptx and b/test/pptx/code-custom/moved-layouts.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index 5e9c2c630..a72bebbe2 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 0e640f373..2bdb526fa 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx index c7f78ac40..df7814599 100644 Binary files a/test/pptx/code/deleted-layouts.pptx and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx index 4d66b1310..71e8560bd 100644 Binary files a/test/pptx/code/moved-layouts.pptx and b/test/pptx/code/moved-layouts.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index aab0cc6f5..4b70df2c7 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index a03109217..1285a9273 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx index 6a5affdbf..27f9d9ac7 100644 Binary files a/test/pptx/comparison/both-columns/deleted-layouts.pptx and b/test/pptx/comparison/both-columns/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx index 88282fabb..a658045ef 100644 Binary files a/test/pptx/comparison/both-columns/moved-layouts.pptx and b/test/pptx/comparison/both-columns/moved-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx index 477072fb4..560c7d41a 100644 Binary files a/test/pptx/comparison/both-columns/output.pptx and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx index 431d22392..2fb38880d 100644 Binary files a/test/pptx/comparison/both-columns/templated.pptx and b/test/pptx/comparison/both-columns/templated.pptx differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx index beed077f7..267c7cb69 100644 Binary files a/test/pptx/comparison/extra-image/deleted-layouts.pptx and b/test/pptx/comparison/extra-image/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx index f86f5b043..b7023026c 100644 Binary files a/test/pptx/comparison/extra-image/moved-layouts.pptx and b/test/pptx/comparison/extra-image/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx index a0eb5e847..06d632ee7 100644 Binary files a/test/pptx/comparison/extra-image/output.pptx and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx index a434ba29f..af84388c4 100644 Binary files a/test/pptx/comparison/extra-image/templated.pptx and b/test/pptx/comparison/extra-image/templated.pptx differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx index 6a5affdbf..27f9d9ac7 100644 Binary files a/test/pptx/comparison/extra-text/deleted-layouts.pptx and b/test/pptx/comparison/extra-text/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx index 88282fabb..a658045ef 100644 Binary files a/test/pptx/comparison/extra-text/moved-layouts.pptx and b/test/pptx/comparison/extra-text/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx index 8de7d23b2..560c7d41a 100644 Binary files a/test/pptx/comparison/extra-text/output.pptx and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx index 431d22392..2fb38880d 100644 Binary files a/test/pptx/comparison/extra-text/templated.pptx and b/test/pptx/comparison/extra-text/templated.pptx differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx index bd7aa69b7..be30d8368 100644 Binary files a/test/pptx/comparison/non-text-first/deleted-layouts.pptx and b/test/pptx/comparison/non-text-first/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx index a01def95c..c4879b7d5 100644 Binary files a/test/pptx/comparison/non-text-first/moved-layouts.pptx and b/test/pptx/comparison/non-text-first/moved-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx index cb7843fce..099cf6729 100644 Binary files a/test/pptx/comparison/non-text-first/output.pptx and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx index 32db19cbf..31ac01f18 100644 Binary files a/test/pptx/comparison/non-text-first/templated.pptx and b/test/pptx/comparison/non-text-first/templated.pptx differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx index 5fd7cf9b6..27620f05f 100644 Binary files a/test/pptx/comparison/one-column/deleted-layouts.pptx and b/test/pptx/comparison/one-column/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx index d5df2b751..fc64d3af5 100644 Binary files a/test/pptx/comparison/one-column/moved-layouts.pptx and b/test/pptx/comparison/one-column/moved-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx index 6914162ff..854a968af 100644 Binary files a/test/pptx/comparison/one-column/output.pptx and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx index a30a24453..9e671af1d 100644 Binary files a/test/pptx/comparison/one-column/templated.pptx and b/test/pptx/comparison/one-column/templated.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx index b5afcc021..3cd09a916 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx index 05806a767..8e76bc94c 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx index b3e89757b..5c680e878 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/output.pptx and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx index 3b0fe64c3..bdde384a4 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/templated.pptx and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx index e9e0551ac..376880b41 100644 Binary files a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx index 77d706ed3..9e33d3163 100644 Binary files a/test/pptx/content-with-caption/image-text/moved-layouts.pptx and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx index 94a2e8b88..c88030b94 100644 Binary files a/test/pptx/content-with-caption/image-text/output.pptx and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx index bef1921a7..a22e9ae3e 100644 Binary files a/test/pptx/content-with-caption/image-text/templated.pptx and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx index 68d3d7b9b..2dcb8b78e 100644 Binary files a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx index feade1096..7d187a168 100644 Binary files a/test/pptx/content-with-caption/text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx index efa814d65..751121cf2 100644 Binary files a/test/pptx/content-with-caption/text-image/output.pptx and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx index ebd552252..4f0aaaa7a 100644 Binary files a/test/pptx/content-with-caption/text-image/templated.pptx and b/test/pptx/content-with-caption/text-image/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx index a866f3c1f..79517481a 100644 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx index 8834f885f..51608c2e9 100644 Binary files a/test/pptx/document-properties-short-desc/moved-layouts.pptx and b/test/pptx/document-properties-short-desc/moved-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx index de5e68151..02c241b89 100644 Binary files a/test/pptx/document-properties-short-desc/output.pptx and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/templated.pptx b/test/pptx/document-properties-short-desc/templated.pptx index d39dc0c91..82ccc072c 100644 Binary files a/test/pptx/document-properties-short-desc/templated.pptx and b/test/pptx/document-properties-short-desc/templated.pptx differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx index 1f52481f3..12f6570cf 100644 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx index c1d2d5282..9a9d4ac3e 100644 Binary files a/test/pptx/document-properties/moved-layouts.pptx and b/test/pptx/document-properties/moved-layouts.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx index 6bcbd1b9c..cfd3261bc 100644 Binary files a/test/pptx/document-properties/output.pptx and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/document-properties/templated.pptx b/test/pptx/document-properties/templated.pptx index 841ae8c42..3d52d22df 100644 Binary files a/test/pptx/document-properties/templated.pptx and b/test/pptx/document-properties/templated.pptx differ diff --git a/test/pptx/endnotes-toc/deleted-layouts.pptx b/test/pptx/endnotes-toc/deleted-layouts.pptx index 60110a64e..3e613e038 100644 Binary files a/test/pptx/endnotes-toc/deleted-layouts.pptx and b/test/pptx/endnotes-toc/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes-toc/moved-layouts.pptx b/test/pptx/endnotes-toc/moved-layouts.pptx index d1200bd7d..e64cd9c77 100644 Binary files a/test/pptx/endnotes-toc/moved-layouts.pptx and b/test/pptx/endnotes-toc/moved-layouts.pptx differ diff --git a/test/pptx/endnotes-toc/output.pptx b/test/pptx/endnotes-toc/output.pptx index a028b346f..bb431f511 100644 Binary files a/test/pptx/endnotes-toc/output.pptx and b/test/pptx/endnotes-toc/output.pptx differ diff --git a/test/pptx/endnotes-toc/templated.pptx b/test/pptx/endnotes-toc/templated.pptx index 38a0c437d..63b066f0d 100644 Binary files a/test/pptx/endnotes-toc/templated.pptx and b/test/pptx/endnotes-toc/templated.pptx differ diff --git a/test/pptx/endnotes/deleted-layouts.pptx b/test/pptx/endnotes/deleted-layouts.pptx index 0b0bd2f53..1d7ccb928 100644 Binary files a/test/pptx/endnotes/deleted-layouts.pptx and b/test/pptx/endnotes/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes/moved-layouts.pptx b/test/pptx/endnotes/moved-layouts.pptx index 0d4c491b9..0f071207c 100644 Binary files a/test/pptx/endnotes/moved-layouts.pptx and b/test/pptx/endnotes/moved-layouts.pptx differ diff --git a/test/pptx/endnotes/output.pptx b/test/pptx/endnotes/output.pptx index 9d46036fe..e4e661804 100644 Binary files a/test/pptx/endnotes/output.pptx and b/test/pptx/endnotes/output.pptx differ diff --git a/test/pptx/endnotes/templated.pptx b/test/pptx/endnotes/templated.pptx index 863cc29d4..a97a7eed8 100644 Binary files a/test/pptx/endnotes/templated.pptx and b/test/pptx/endnotes/templated.pptx differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx index 2f8754e90..9f0f41c37 100644 Binary files a/test/pptx/images/deleted-layouts.pptx and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx index 7951a09f6..f26ac9e8f 100644 Binary files a/test/pptx/images/moved-layouts.pptx and b/test/pptx/images/moved-layouts.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx index 89325e577..993209a45 100644 Binary files a/test/pptx/images/output.pptx and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/images/templated.pptx b/test/pptx/images/templated.pptx index 7c0ed9a17..06b337538 100644 Binary files a/test/pptx/images/templated.pptx and b/test/pptx/images/templated.pptx differ diff --git a/test/pptx/inline-formatting/deleted-layouts.pptx b/test/pptx/inline-formatting/deleted-layouts.pptx index 2fbe21a45..ac9fa4725 100644 Binary files a/test/pptx/inline-formatting/deleted-layouts.pptx and b/test/pptx/inline-formatting/deleted-layouts.pptx differ diff --git a/test/pptx/inline-formatting/moved-layouts.pptx b/test/pptx/inline-formatting/moved-layouts.pptx index 427492130..49a2409d1 100644 Binary files a/test/pptx/inline-formatting/moved-layouts.pptx and b/test/pptx/inline-formatting/moved-layouts.pptx differ diff --git a/test/pptx/inline-formatting/output.pptx b/test/pptx/inline-formatting/output.pptx index 473b9498d..f1a4a0a36 100644 Binary files a/test/pptx/inline-formatting/output.pptx and b/test/pptx/inline-formatting/output.pptx differ diff --git a/test/pptx/inline-formatting/templated.pptx b/test/pptx/inline-formatting/templated.pptx index dd778a102..6930b785c 100644 Binary files a/test/pptx/inline-formatting/templated.pptx and b/test/pptx/inline-formatting/templated.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx index e527d3c5f..1670eada1 100644 Binary files a/test/pptx/lists/deleted-layouts.pptx and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx index 2947c3211..f7590c5f9 100644 Binary files a/test/pptx/lists/moved-layouts.pptx and b/test/pptx/lists/moved-layouts.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index ffc2eb9f7..95510e92e 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 2493e7890..7af437bfe 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/raw-ooxml/deleted-layouts.pptx b/test/pptx/raw-ooxml/deleted-layouts.pptx index 2da1b7a63..a7bd12281 100644 Binary files a/test/pptx/raw-ooxml/deleted-layouts.pptx and b/test/pptx/raw-ooxml/deleted-layouts.pptx differ diff --git a/test/pptx/raw-ooxml/moved-layouts.pptx b/test/pptx/raw-ooxml/moved-layouts.pptx index e58304172..614682671 100644 Binary files a/test/pptx/raw-ooxml/moved-layouts.pptx and b/test/pptx/raw-ooxml/moved-layouts.pptx differ diff --git a/test/pptx/raw-ooxml/output.pptx b/test/pptx/raw-ooxml/output.pptx index 29164af15..841495315 100644 Binary files a/test/pptx/raw-ooxml/output.pptx and b/test/pptx/raw-ooxml/output.pptx differ diff --git a/test/pptx/raw-ooxml/templated.pptx b/test/pptx/raw-ooxml/templated.pptx index 0f20f9826..1dd23da2e 100644 Binary files a/test/pptx/raw-ooxml/templated.pptx and b/test/pptx/raw-ooxml/templated.pptx differ diff --git a/test/pptx/remove-empty-slides/deleted-layouts.pptx b/test/pptx/remove-empty-slides/deleted-layouts.pptx index 51981b241..488abc02a 100644 Binary files a/test/pptx/remove-empty-slides/deleted-layouts.pptx and b/test/pptx/remove-empty-slides/deleted-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/moved-layouts.pptx b/test/pptx/remove-empty-slides/moved-layouts.pptx index ddca32a52..1e1cf1e44 100644 Binary files a/test/pptx/remove-empty-slides/moved-layouts.pptx and b/test/pptx/remove-empty-slides/moved-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/output.pptx b/test/pptx/remove-empty-slides/output.pptx index 9e8b5eed2..e2871a882 100644 Binary files a/test/pptx/remove-empty-slides/output.pptx and b/test/pptx/remove-empty-slides/output.pptx differ diff --git a/test/pptx/remove-empty-slides/templated.pptx b/test/pptx/remove-empty-slides/templated.pptx index 579467452..c730b2103 100644 Binary files a/test/pptx/remove-empty-slides/templated.pptx and b/test/pptx/remove-empty-slides/templated.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx index 2c891cd1d..334fdea9c 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx index 8471b1d10..3faabfd93 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx index 449339778..96b9907cc 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/output.pptx and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/templated.pptx b/test/pptx/slide-breaks-slide-level-1/templated.pptx index e2815159a..9f23f1d9f 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/templated.pptx and b/test/pptx/slide-breaks-slide-level-1/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx index b63994cce..0492ee2ec 100644 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx index 918264bc5..f3e56652c 100644 Binary files a/test/pptx/slide-breaks-toc/moved-layouts.pptx and b/test/pptx/slide-breaks-toc/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index 9dbfa41a0..b3063b15e 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index b83f3f596..bcb2f8276 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx index fbf4054be..827c7dfda 100644 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx index 90b3b94a6..241605754 100644 Binary files a/test/pptx/slide-breaks/moved-layouts.pptx and b/test/pptx/slide-breaks/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx index e06d9079d..55c09a80e 100644 Binary files a/test/pptx/slide-breaks/output.pptx and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-breaks/templated.pptx b/test/pptx/slide-breaks/templated.pptx index 71ba99701..f60f7da06 100644 Binary files a/test/pptx/slide-breaks/templated.pptx and b/test/pptx/slide-breaks/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx index 217b000b6..c315a7a7a 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx index d8a6c90fe..81b49936d 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx index 512b324bf..3f815d830 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx index 5ab88e94c..b270d2d4f 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx index 5be799e3b..7bc7cfeee 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx index 395036069..602df1c77 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx index 2f3a53f5c..f725760dc 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/output.pptx and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/templated.pptx b/test/pptx/slide-level-0/h1-with-image/templated.pptx index d306375e9..b203ff671 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/templated.pptx and b/test/pptx/slide-level-0/h1-with-image/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx index 127dcea01..9d58c2c52 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx index 197499bc3..62424de73 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/output.pptx b/test/pptx/slide-level-0/h1-with-table/output.pptx index 44dbbf90c..d30fd88c3 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/output.pptx and b/test/pptx/slide-level-0/h1-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/templated.pptx b/test/pptx/slide-level-0/h1-with-table/templated.pptx index 87b45dda2..eb2a78647 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/templated.pptx and b/test/pptx/slide-level-0/h1-with-table/templated.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx index 5be799e3b..7bc7cfeee 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx index 395036069..602df1c77 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx index 948659d6a..f725760dc 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/output.pptx and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/templated.pptx b/test/pptx/slide-level-0/h2-with-image/templated.pptx index d306375e9..b203ff671 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/templated.pptx and b/test/pptx/slide-level-0/h2-with-image/templated.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 48f75ae42..9010ba04a 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx index 8f7aee710..ca53605b7 100644 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index 7fe3d3ae7..607115858 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx index a9e883ada..3be3ed0af 100644 Binary files a/test/pptx/speaker-notes-after-metadata/templated.pptx and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 831d37446..2c2a0936b 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx index 7ba1c3a11..a9c8bfa0a 100644 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index bcb5dd214..ff403aa1c 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx index 010c4cce4..15435c45a 100644 Binary files a/test/pptx/speaker-notes-afterheader/templated.pptx and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index de607ae41..f6abb0b27 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx index 8eb81bee1..6a770fc75 100644 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 4288b84b6..7e56147f1 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index 96338a2b5..3184ff74e 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index 558bb7930..5429b88e0 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx index 283170569..13e34698d 100644 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index f0e51e597..74041a40d 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx index 27df2d994..80a3e3dea 100644 Binary files a/test/pptx/speaker-notes/templated.pptx and b/test/pptx/speaker-notes/templated.pptx differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx index 68b4215df..7bfe9868f 100644 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx index e1b2d4de8..0100365ec 100644 Binary files a/test/pptx/start-numbering-at/moved-layouts.pptx and b/test/pptx/start-numbering-at/moved-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index 4320128b3..3ba9a236a 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index efc56ac7a..8a144d601 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx index d533d3c28..163d4ca5e 100644 Binary files a/test/pptx/tables/deleted-layouts.pptx and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx index 56608a039..1b0e606da 100644 Binary files a/test/pptx/tables/moved-layouts.pptx and b/test/pptx/tables/moved-layouts.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx index e41219844..1c89d8032 100644 Binary files a/test/pptx/tables/output.pptx and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/tables/templated.pptx b/test/pptx/tables/templated.pptx index 0a8c3e8d9..5755bfe9d 100644 Binary files a/test/pptx/tables/templated.pptx and b/test/pptx/tables/templated.pptx differ diff --git a/test/pptx/two-column/deleted-layouts.pptx b/test/pptx/two-column/deleted-layouts.pptx index 9622ed2cd..1d7bd87d3 100644 Binary files a/test/pptx/two-column/deleted-layouts.pptx and b/test/pptx/two-column/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/moved-layouts.pptx b/test/pptx/two-column/moved-layouts.pptx index a17f96b18..71760268c 100644 Binary files a/test/pptx/two-column/moved-layouts.pptx and b/test/pptx/two-column/moved-layouts.pptx differ diff --git a/test/pptx/two-column/output.pptx b/test/pptx/two-column/output.pptx index 270a7eeac..396dc2a74 100644 Binary files a/test/pptx/two-column/output.pptx and b/test/pptx/two-column/output.pptx differ diff --git a/test/pptx/two-column/templated.pptx b/test/pptx/two-column/templated.pptx index 6d9470372..8901695b1 100644 Binary files a/test/pptx/two-column/templated.pptx and b/test/pptx/two-column/templated.pptx differ -- cgit v1.2.3 From 0ebe65e651766a2b3d006d3dee4afdfd43a386d5 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Wed, 8 Sep 2021 14:05:22 +0100 Subject: pptx: Fix logic for choosing Comparison layout There was a mistake in the logic used to choose between the Comparison and Two Content layouts: if one column contained only non-text (an image or a table) and the other contained only text, the Comparison layout was chosen instead of the desired Two Content layout. This commit fixes that logic: > If either column contains text followed by non-text, use Comparison. Otherwise, use Two Content. It also adds a test asserting this behaviour. --- pandoc.cabal | 6 ++++-- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 9 +++++---- test/Tests/Writers/Powerpoint.hs | 8 ++++++-- test/pptx/two-column/all-text/deleted-layouts.pptx | Bin 0 -> 30568 bytes test/pptx/two-column/all-text/input.native | 9 +++++++++ test/pptx/two-column/all-text/moved-layouts.pptx | Bin 0 -> 41256 bytes test/pptx/two-column/all-text/output.pptx | Bin 0 -> 27689 bytes test/pptx/two-column/all-text/templated.pptx | Bin 0 -> 40756 bytes test/pptx/two-column/deleted-layouts.pptx | Bin 30568 -> 0 bytes test/pptx/two-column/input.native | 9 --------- test/pptx/two-column/moved-layouts.pptx | Bin 41256 -> 0 bytes test/pptx/two-column/output.pptx | Bin 27689 -> 0 bytes test/pptx/two-column/templated.pptx | Bin 40756 -> 0 bytes .../pptx/two-column/text-and-image/deleted-layouts.pptx | Bin 0 -> 48392 bytes test/pptx/two-column/text-and-image/input.native | 12 ++++++++++++ test/pptx/two-column/text-and-image/moved-layouts.pptx | Bin 0 -> 59086 bytes test/pptx/two-column/text-and-image/output.pptx | Bin 0 -> 45520 bytes test/pptx/two-column/text-and-image/templated.pptx | Bin 0 -> 58586 bytes 18 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 test/pptx/two-column/all-text/deleted-layouts.pptx create mode 100644 test/pptx/two-column/all-text/input.native create mode 100644 test/pptx/two-column/all-text/moved-layouts.pptx create mode 100644 test/pptx/two-column/all-text/output.pptx create mode 100644 test/pptx/two-column/all-text/templated.pptx delete mode 100644 test/pptx/two-column/deleted-layouts.pptx delete mode 100644 test/pptx/two-column/input.native delete mode 100644 test/pptx/two-column/moved-layouts.pptx delete mode 100644 test/pptx/two-column/output.pptx delete mode 100644 test/pptx/two-column/templated.pptx create mode 100644 test/pptx/two-column/text-and-image/deleted-layouts.pptx create mode 100644 test/pptx/two-column/text-and-image/input.native create mode 100644 test/pptx/two-column/text-and-image/moved-layouts.pptx create mode 100644 test/pptx/two-column/text-and-image/output.pptx create mode 100644 test/pptx/two-column/text-and-image/templated.pptx (limited to 'test/pptx') diff --git a/pandoc.cabal b/pandoc.cabal index 3de7da39c..347c33d51 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -446,8 +446,10 @@ extra-source-files: test/pptx/start-numbering-at/*.pptx test/pptx/tables/input.native test/pptx/tables/*.pptx - test/pptx/two-column/input.native - test/pptx/two-column/*.pptx + test/pptx/two-column/all-text/input.native + test/pptx/two-column/all-text/*.pptx + test/pptx/two-column/text-and-image/input.native + test/pptx/two-column/text-and-image/*.pptx test/ipynb/*.in.native test/ipynb/*.out.native test/ipynb/*.ipynb diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 10060d975..015e2cbdd 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -696,10 +696,11 @@ bodyBlocksToSlide _ (blk : blks) spkNotes sldId (ComparisonSlide [] (shapesL1, shapesL2) (shapesR1, shapesR2)) spkNotes - case (break notText blksL, break notText blksR) of - ((_, []), (_, [])) -> mkTwoColumn blksL blksR - (([], _), ([], _)) -> mkTwoColumn blksL blksR - ((blksL1, blksL2), (blksR1, blksR2)) -> mkComparison blksL1 blksL2 blksR1 blksR2 + let (blksL1, blksL2) = break notText blksL + (blksR1, blksR2) = break notText blksR + if (any null [blksL1, blksL2]) && (any null [blksR1, blksR2]) + then mkTwoColumn blksL blksR + else mkComparison blksL1 blksL2 blksR1 blksR2 bodyBlocksToSlide _ (blk : blks) spkNotes = do sldId <- asks envCurSlideId inNoteSlide <- asks envInNoteSlide diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 256ee1f7f..dd3846fef 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -103,8 +103,12 @@ tests = groupPptxTests [ pptxTests "Inline formatting" "pptx/images/output.pptx" , pptxTests "two-column layout" def - "pptx/two-column/input.native" - "pptx/two-column/output.pptx" + "pptx/two-column/all-text/input.native" + "pptx/two-column/all-text/output.pptx" + , pptxTests "two-column (not comparison)" + def + "pptx/two-column/text-and-image/input.native" + "pptx/two-column/text-and-image/output.pptx" , pptxTests "speaker notes" def "pptx/speaker-notes/input.native" diff --git a/test/pptx/two-column/all-text/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx new file mode 100644 index 000000000..1d7bd87d3 Binary files /dev/null and b/test/pptx/two-column/all-text/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/input.native b/test/pptx/two-column/all-text/input.native new file mode 100644 index 000000000..086f74889 --- /dev/null +++ b/test/pptx/two-column/all-text/input.native @@ -0,0 +1,9 @@ +Pandoc (Meta {unMeta = fromList []}) +[Header 1 ("two-column-layout",[],[]) [Str "Two-Column",Space,Str "Layout"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "One",Space,Str "paragraph."] + ,Para [Str "Another",Space,Str "paragraph."]] + ,Div ("",["column"],[]) + [Para [Str "Second",Space,Str "column",Space,Str "paragraph."] + ,Para [Str "Another",Space,Str "second",Space,Str "paragraph."]]]] diff --git a/test/pptx/two-column/all-text/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx new file mode 100644 index 000000000..71760268c Binary files /dev/null and b/test/pptx/two-column/all-text/moved-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/output.pptx b/test/pptx/two-column/all-text/output.pptx new file mode 100644 index 000000000..396dc2a74 Binary files /dev/null and b/test/pptx/two-column/all-text/output.pptx differ diff --git a/test/pptx/two-column/all-text/templated.pptx b/test/pptx/two-column/all-text/templated.pptx new file mode 100644 index 000000000..8901695b1 Binary files /dev/null and b/test/pptx/two-column/all-text/templated.pptx differ diff --git a/test/pptx/two-column/deleted-layouts.pptx b/test/pptx/two-column/deleted-layouts.pptx deleted file mode 100644 index 1d7bd87d3..000000000 Binary files a/test/pptx/two-column/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/input.native b/test/pptx/two-column/input.native deleted file mode 100644 index 086f74889..000000000 --- a/test/pptx/two-column/input.native +++ /dev/null @@ -1,9 +0,0 @@ -Pandoc (Meta {unMeta = fromList []}) -[Header 1 ("two-column-layout",[],[]) [Str "Two-Column",Space,Str "Layout"] -,Div ("",["columns"],[]) - [Div ("",["column"],[]) - [Para [Str "One",Space,Str "paragraph."] - ,Para [Str "Another",Space,Str "paragraph."]] - ,Div ("",["column"],[]) - [Para [Str "Second",Space,Str "column",Space,Str "paragraph."] - ,Para [Str "Another",Space,Str "second",Space,Str "paragraph."]]]] diff --git a/test/pptx/two-column/moved-layouts.pptx b/test/pptx/two-column/moved-layouts.pptx deleted file mode 100644 index 71760268c..000000000 Binary files a/test/pptx/two-column/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/output.pptx b/test/pptx/two-column/output.pptx deleted file mode 100644 index 396dc2a74..000000000 Binary files a/test/pptx/two-column/output.pptx and /dev/null differ diff --git a/test/pptx/two-column/templated.pptx b/test/pptx/two-column/templated.pptx deleted file mode 100644 index 8901695b1..000000000 Binary files a/test/pptx/two-column/templated.pptx and /dev/null differ diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx new file mode 100644 index 000000000..297fd6bad Binary files /dev/null and b/test/pptx/two-column/text-and-image/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/input.native b/test/pptx/two-column/text-and-image/input.native new file mode 100644 index 000000000..796c2c7f4 --- /dev/null +++ b/test/pptx/two-column/text-and-image/input.native @@ -0,0 +1,12 @@ +[Header 1 ("slide-1",[],[]) [Str "Slide",Space,Str "1"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [Para [Str "This",Space,Str "should",Space,Str "use",Space,Str "Two",Space,Str "Content,",Space,Emph [Str "not"],Space,Str "Comparison!"]]] +,Header 1 ("slide-2",[],[]) [Str "Slide",Space,Str "2"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "This",Space,Str "should",Space,Str "also",Space,Str "use",Space,Str "Two",Space,Str "Content"]] + ,Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx new file mode 100644 index 000000000..c9a6e577e Binary files /dev/null and b/test/pptx/two-column/text-and-image/moved-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx new file mode 100644 index 000000000..bfd532ed9 Binary files /dev/null and b/test/pptx/two-column/text-and-image/output.pptx differ diff --git a/test/pptx/two-column/text-and-image/templated.pptx b/test/pptx/two-column/text-and-image/templated.pptx new file mode 100644 index 000000000..23e6b283f Binary files /dev/null and b/test/pptx/two-column/text-and-image/templated.pptx differ -- cgit v1.2.3 From 0fb6474a55427b52bf9aebd179f7b26f30c7dbaf Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Tue, 7 Sep 2021 13:38:47 +0100 Subject: pptx: Add support for incremental lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Support -i option - Support incremental/noincremental divs - Support older block quote syntax - Add tests One thing not clear from the manual is what should happen when the input uses a combination of these things. For example, what should the following produce? ```md ::: {.incremental .nonincremental} - are - these - incremental? ::: ::: incremental ::::: nonincremental - or - these? ::::: ::: ::: nonincremental > - how > - about > - these? ::: ``` In this commit I’ve taken the following approach, matching the observed behaviour for beamer and reveal.js output: - if a div with both classes, incremental wins - the innermost incremental/nonincremental div is the one which takes effect - a block quote containing a list as its first element inverts whether the list is incremental, whether or not the quote is inside an incremental/non-incremental div I’ve added some tests to verify this behaviour. This commit closes issue #5689 (https://github.com/jgm/pandoc/issues/5689). --- MANUAL.txt | 3 - pandoc.cabal | 4 + src/Text/Pandoc/Writers/Powerpoint/Output.hs | 566 +++++++++++++++------ src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 51 +- test/Tests/Writers/Powerpoint.hs | 8 + .../with-flag/deleted-layouts.pptx | Bin 0 -> 80172 bytes test/pptx/incremental-lists/with-flag/input.native | 139 +++++ .../incremental-lists/with-flag/moved-layouts.pptx | Bin 0 -> 90917 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 0 -> 77298 bytes .../incremental-lists/with-flag/templated.pptx | Bin 0 -> 90414 bytes .../without-flag/deleted-layouts.pptx | Bin 0 -> 78405 bytes .../incremental-lists/without-flag/input.native | 137 +++++ .../without-flag/moved-layouts.pptx | Bin 0 -> 89148 bytes .../incremental-lists/without-flag/output.pptx | Bin 0 -> 75533 bytes .../incremental-lists/without-flag/templated.pptx | Bin 0 -> 88645 bytes 15 files changed, 743 insertions(+), 165 deletions(-) create mode 100644 test/pptx/incremental-lists/with-flag/deleted-layouts.pptx create mode 100644 test/pptx/incremental-lists/with-flag/input.native create mode 100644 test/pptx/incremental-lists/with-flag/moved-layouts.pptx create mode 100644 test/pptx/incremental-lists/with-flag/output.pptx create mode 100644 test/pptx/incremental-lists/with-flag/templated.pptx create mode 100644 test/pptx/incremental-lists/without-flag/deleted-layouts.pptx create mode 100644 test/pptx/incremental-lists/without-flag/input.native create mode 100644 test/pptx/incremental-lists/without-flag/moved-layouts.pptx create mode 100644 test/pptx/incremental-lists/without-flag/output.pptx create mode 100644 test/pptx/incremental-lists/without-flag/templated.pptx (limited to 'test/pptx') diff --git a/MANUAL.txt b/MANUAL.txt index b65e45bfe..82fc21684 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5919,9 +5919,6 @@ option): Both methods allow incremental and nonincremental lists to be mixed in a single document. -Note: Neither the `-i/--incremental` option nor any of the -methods described here currently works for PowerPoint output. - ## Inserting pauses You can add "pauses" within a slide by including a paragraph containing diff --git a/pandoc.cabal b/pandoc.cabal index 347c33d51..6fcc384f9 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -414,6 +414,10 @@ extra-source-files: test/pptx/endnotes/*.pptx test/pptx/images/input.native test/pptx/images/*.pptx + test/pptx/incremental-lists/with-flag/input.native + test/pptx/incremental-lists/with-flag/*.pptx + test/pptx/incremental-lists/without-flag/input.native + test/pptx/incremental-lists/without-flag/*.pptx test/pptx/inline-formatting/input.native test/pptx/inline-formatting/*.pptx test/pptx/lists/input.native diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 14cd82fdf..5eadf1312 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -1,7 +1,9 @@ {-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TupleSections #-} {- | Module : Text.Pandoc.Writers.Powerpoint.Output Copyright : Copyright (C) 2017-2020 Jesse Rosenthal @@ -23,6 +25,7 @@ import Control.Monad.Reader import Control.Monad.State import Codec.Archive.Zip import Data.List (intercalate, stripPrefix, nub, union, isPrefixOf, intersperse) +import Data.Bifunctor (bimap) import Data.CaseInsensitive (CI) import qualified Data.CaseInsensitive as CI import Data.Default @@ -415,7 +418,7 @@ updateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels) maxIdNumber :: Element -> Integer maxIdNumber relationships = maximum (0 : idNumbers) where - idNumbers = fst <$> mapMaybe (hush . decimal . T.drop 3) idAttributes + idNumbers = mapMaybe (readTextAsInteger . T.drop 3) idAttributes idAttributes = mapMaybe getIdAttribute (elContent relationships) getIdAttribute (Elem e) = findAttr (QName "Id" Nothing Nothing) e getIdAttribute _ = Nothing @@ -423,14 +426,11 @@ updateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels) maxIdNumber' :: Element -> Integer maxIdNumber' sldLayouts = maximum (0 : idNumbers) where - idNumbers = fst <$> mapMaybe (hush . decimal) idAttributes + idNumbers = mapMaybe readTextAsInteger idAttributes idAttributes = mapMaybe getIdAttribute (elContent sldLayouts) getIdAttribute (Elem e) = findAttr (QName "id" Nothing Nothing) e getIdAttribute _ = Nothing -hush :: Either a b -> Maybe b -hush = either (const Nothing) Just - makeSlideIdMap :: Presentation -> M.Map SlideId Int makeSlideIdMap (Presentation _ slides) = M.fromList $ map slideId slides `zip` [1..] @@ -575,19 +575,24 @@ getLayout layout = getElement <$> getSlideLayouts BlankSlide{} -> blank shapeHasId :: NameSpaces -> T.Text -> Element -> Bool -shapeHasId ns ident element - | Just nvSpPr <- findChild (elemName ns "p" "nvSpPr") element - , Just cNvPr <- findChild (elemName ns "p" "cNvPr") nvSpPr - , Just nm <- findAttr (QName "id" Nothing Nothing) cNvPr = - nm == ident - | otherwise = False +shapeHasId ns ident element = getShapeId ns element == Just ident + +getShapeId :: NameSpaces -> Element -> Maybe Text +getShapeId ns element = do + nvSpPr <- findChild (elemName ns "p" "nvSpPr") element + cNvPr <- findChild (elemName ns "p" "cNvPr") nvSpPr + findAttr (QName "id" Nothing Nothing) cNvPr -getContentShape :: PandocMonad m => NameSpaces -> Element -> P m Element +type ShapeId = Integer + +getContentShape :: PandocMonad m => NameSpaces -> Element -> P m (Maybe ShapeId, Element) getContentShape ns spTreeElem | isElem ns "p" "spTree" spTreeElem = do - ph@Placeholder{..} <- asks envPlaceholder + ph@Placeholder{index, placeholderType} <- asks envPlaceholder case drop index (getShapesByPlaceHolderType ns spTreeElem placeholderType) of - sp : _ -> return sp + sp : _ -> let + shapeId = getShapeId ns sp >>= readTextAsInteger + in return (shapeId, sp) [] -> throwError $ PandocSomeError $ missingPlaceholderMessage ph getContentShape _ _ = throwError $ PandocSomeError "Attempted to find content on non shapeTree" @@ -651,7 +656,7 @@ getContentShapeSize ns layout master | isElem ns "p" "sldLayout" layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - sp <- getContentShape ns spTree + (_, sp) <- getContentShape ns spTree case getShapeDimensions ns sp of Just sz -> return sz Nothing -> do let mbSz = @@ -873,33 +878,35 @@ captionHeight = 40 createCaption :: PandocMonad m => ((Integer, Integer), (Integer, Integer)) -> [ParaElem] - -> P m Element + -> P m (ShapeId, Element) createCaption contentShapeDimensions paraElements = do let para = Paragraph def{pPropAlign = Just AlgnCenter} paraElements elements <- mapM paragraphToElement [para] let ((x, y), (cx, cy)) = contentShapeDimensions let txBody = mknode "p:txBody" [] $ [mknode "a:bodyPr" [] (), mknode "a:lstStyle" [] ()] <> elements - return $ - mknode "p:sp" [] [ mknode "p:nvSpPr" [] - [ mknode "p:cNvPr" [("id","1"), ("name","TextBox 3")] () - , mknode "p:cNvSpPr" [("txBox", "1")] () - , mknode "p:nvPr" [] () - ] - , mknode "p:spPr" [] - [ mknode "a:xfrm" [] - [ mknode "a:off" [("x", tshow $ 12700 * x), - ("y", tshow $ 12700 * (y + cy - captionHeight))] () - , mknode "a:ext" [("cx", tshow $ 12700 * cx), - ("cy", tshow $ 12700 * captionHeight)] () - ] - , mknode "a:prstGeom" [("prst", "rect")] - [ mknode "a:avLst" [] () - ] - , mknode "a:noFill" [] () - ] - , txBody - ] + return + ( 1 + , mknode "p:sp" [] [ mknode "p:nvSpPr" [] + [ mknode "p:cNvPr" [("id","1"), ("name","TextBox 3")] () + , mknode "p:cNvSpPr" [("txBox", "1")] () + , mknode "p:nvPr" [] () + ] + , mknode "p:spPr" [] + [ mknode "a:xfrm" [] + [ mknode "a:off" [("x", tshow $ 12700 * x), + ("y", tshow $ 12700 * (y + cy - captionHeight))] () + , mknode "a:ext" [("cx", tshow $ 12700 * cx), + ("cy", tshow $ 12700 * captionHeight)] () + ] + , mknode "a:prstGeom" [("prst", "rect")] + [ mknode "a:avLst" [] () + ] + , mknode "a:noFill" [] () + ] + , txBody + ] + ) makePicElements :: PandocMonad m => Element @@ -907,7 +914,7 @@ makePicElements :: PandocMonad m -> MediaInfo -> Text -> [ParaElem] - -> P m [Element] + -> P m [(ShapeId, Element)] makePicElements layout picProps mInfo titleText alt = do opts <- asks envOpts (pageWidth, pageHeight) <- asks envPresentationSize @@ -975,10 +982,12 @@ makePicElements layout picProps mInfo titleText alt = do let spPr = mknode "p:spPr" [("bwMode","auto")] [xfrm, prstGeom, mknode "a:noFill" [] (), ln] - let picShape = mknode "p:pic" [] - [ nvPicPr - , blipFill - , spPr ] + let picShape = ( 0 + , mknode "p:pic" [] + [ nvPicPr + , blipFill + , spPr ] + ) -- And now, maybe create the caption: if hasCaption @@ -1125,44 +1134,50 @@ paragraphToElement par = do return $ mknode "a:p" [] $ [Elem $ mknode "a:pPr" attrs props] <> concat paras -shapeToElement :: PandocMonad m => Element -> Shape -> P m Element +shapeToElement :: PandocMonad m => Element -> Shape -> P m (Maybe ShapeId, Element) shapeToElement layout (TextBox paras) | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - sp <- getContentShape ns spTree + (shapeId, sp) <- getContentShape ns spTree elements <- mapM paragraphToElement paras let txBody = mknode "p:txBody" [] $ [mknode "a:bodyPr" [] (), mknode "a:lstStyle" [] ()] <> elements emptySpPr = mknode "p:spPr" [] () return + . (shapeId,) . surroundWithMathAlternate . replaceNamedChildren ns "p" "txBody" [txBody] . replaceNamedChildren ns "p" "spPr" [emptySpPr] $ sp -- GraphicFrame and Pic should never reach this. -shapeToElement _ _ = return $ mknode "p:sp" [] () +shapeToElement _ _ = return (Nothing, mknode "p:sp" [] ()) -shapeToElements :: PandocMonad m => Element -> Shape -> P m [Content] +shapeToElements :: PandocMonad m => Element -> Shape -> P m [(Maybe ShapeId, Content)] shapeToElements layout (Pic picProps fp titleText alt) = do mInfo <- registerMedia fp alt case mInfoExt mInfo of - Just _ -> map Elem <$> + Just _ -> map (bimap Just Elem) <$> makePicElements layout picProps mInfo titleText alt Nothing -> shapeToElements layout $ TextBox [Paragraph def alt] -shapeToElements layout (GraphicFrame tbls cptn) = map Elem <$> +shapeToElements layout (GraphicFrame tbls cptn) = map (bimap Just Elem) <$> graphicFrameToElements layout tbls cptn shapeToElements _ (RawOOXMLShape str) = return - [Text (CData CDataRaw str Nothing)] + [(Nothing, Text (CData CDataRaw str Nothing))] shapeToElements layout shp = do - element <- shapeToElement layout shp - return [Elem element] + (shapeId, element) <- shapeToElement layout shp + return [(shapeId, Elem element)] -shapesToElements :: PandocMonad m => Element -> [Shape] -> P m [Content] +shapesToElements :: PandocMonad m => Element -> [Shape] -> P m [(Maybe ShapeId, Content)] shapesToElements layout shps = concat <$> mapM (shapeToElements layout) shps -graphicFrameToElements :: PandocMonad m => Element -> [Graphic] -> [ParaElem] -> P m [Element] +graphicFrameToElements :: + PandocMonad m => + Element -> + [Graphic] -> + [ParaElem] -> + P m [(ShapeId, Element)] graphicFrameToElements layout tbls caption = do -- get the sizing master <- getMaster @@ -1176,21 +1191,23 @@ graphicFrameToElements layout tbls caption = do elements <- mapM (graphicToElement cx) tbls let graphicFrameElts = - mknode "p:graphicFrame" [] $ - [ mknode "p:nvGraphicFramePr" [] - [ mknode "p:cNvPr" [("id", "6"), ("name", "Content Placeholder 5")] () - , mknode "p:cNvGraphicFramePr" [] - [mknode "a:graphicFrameLocks" [("noGrp", "1")] ()] - , mknode "p:nvPr" [] - [mknode "p:ph" [("idx", "1")] ()] - ] - , mknode "p:xfrm" [] - [ mknode "a:off" [("x", tshow $ 12700 * x), - ("y", tshow $ 12700 * y)] () - , mknode "a:ext" [("cx", tshow $ 12700 * cx), - ("cy", tshow $ 12700 * cy)] () - ] - ] <> elements + ( 6 + , mknode "p:graphicFrame" [] $ + [ mknode "p:nvGraphicFramePr" [] + [ mknode "p:cNvPr" [("id", "6"), ("name", "Content Placeholder 5")] () + , mknode "p:cNvGraphicFramePr" [] + [mknode "a:graphicFrameLocks" [("noGrp", "1")] ()] + , mknode "p:nvPr" [] + [mknode "p:ph" [("idx", "1")] ()] + ] + , mknode "p:xfrm" [] + [ mknode "a:off" [("x", tshow $ 12700 * x), + ("y", tshow $ 12700 * y)] () + , mknode "a:ext" [("cx", tshow $ 12700 * cx), + ("cy", tshow $ 12700 * cy)] () + ] + ] <> elements + ) if not $ null caption then do capElt <- createCaption ((x, y), (cx, cytmp)) caption @@ -1312,52 +1329,101 @@ getShapeByPlaceHolderTypes ns spTreeElem (s:ss) = Just element -> Just element Nothing -> getShapeByPlaceHolderTypes ns spTreeElem ss -nonBodyTextToElement :: PandocMonad m => Element -> [PHType] -> [ParaElem] -> P m Element +nonBodyTextToElement :: + PandocMonad m => + Element -> + [PHType] -> + [ParaElem] -> + P m (Maybe ShapeId, Element) nonBodyTextToElement layout phTypes paraElements | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld - , Just sp <- getShapeByPlaceHolderTypes ns spTree phTypes = do + , Just sp <- getShapeByPlaceHolderTypes ns spTree phTypes + , Just nvSpPr <- findChild (elemName ns "p" "nvSpPr") sp + , Just cNvPr <- findChild (elemName ns "p" "cNvPr") nvSpPr + , Just shapeId <- findAttr (nodename "id") cNvPr + , Right (shapeIdNum, _) <- decimal shapeId = do let hdrPara = Paragraph def paraElements element <- paragraphToElement hdrPara let txBody = mknode "p:txBody" [] $ [mknode "a:bodyPr" [] (), mknode "a:lstStyle" [] ()] <> [element] - return $ replaceNamedChildren ns "p" "txBody" [txBody] sp + return (Just shapeIdNum, replaceNamedChildren ns "p" "txBody" [txBody] sp) -- XXX: TODO - | otherwise = return $ mknode "p:sp" [] () + | otherwise = return (Nothing, mknode "p:sp" [] ()) -contentToElement :: PandocMonad m => Element -> [ParaElem] -> [Shape] -> P m Element +data ContentShapeIds = ContentShapeIds + { contentHeaderId :: Maybe ShapeId + , contentContentIds :: [ShapeId] + } + +contentToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + [Shape] -> + P m (Maybe ContentShapeIds, Element) contentToElement layout hdrShape shapes | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - element <- nonBodyTextToElement layout [PHType "title"] hdrShape + (shapeId, element) <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] - contentElements <- local + contentHeaderId = if null hdrShape then Nothing else shapeId + content <- local (\env -> env {envPlaceholder = Placeholder ObjType 0}) (shapesToElements layout shapes) - return $ buildSpTree ns spTree (hdrShapeElements <> contentElements) -contentToElement _ _ _ = return $ mknode "p:sp" [] () - -twoColumnToElement :: PandocMonad m => Element -> [ParaElem] -> [Shape] -> [Shape] -> P m Element + let contentContentIds = mapMaybe fst content + contentElements = snd <$> content + return ( Just ContentShapeIds{..} + , buildSpTree ns spTree (hdrShapeElements <> contentElements) + ) +contentToElement _ _ _ = return (Nothing, mknode "p:sp" [] ()) + +data TwoColumnShapeIds = TwoColumnShapeIds + { twoColumnHeaderId :: Maybe ShapeId + , twoColumnLeftIds :: [ShapeId] + , twoColumnRightIds :: [ShapeId] + } + +twoColumnToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + [Shape] -> + [Shape] -> + P m (Maybe TwoColumnShapeIds, Element) twoColumnToElement layout hdrShape shapesL shapesR | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - element <- nonBodyTextToElement layout [PHType "title"] hdrShape + (headerId, element) <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] - contentElementsL <- local - (\env -> env {envPlaceholder = Placeholder ObjType 0}) - (shapesToElements layout shapesL) - contentElementsR <- local - (\env -> env {envPlaceholder = Placeholder ObjType 1}) - (shapesToElements layout shapesR) + twoColumnHeaderId = if null hdrShape then Nothing else headerId + contentL <- local (\env -> env {envPlaceholder = Placeholder ObjType 0}) + (shapesToElements layout shapesL) + let twoColumnLeftIds = mapMaybe fst contentL + contentElementsL = snd <$> contentL + contentR <- local (\env -> env {envPlaceholder = Placeholder ObjType 1}) + (shapesToElements layout shapesR) + let (twoColumnRightIds) = (mapMaybe fst contentR) + contentElementsR = snd <$> contentR -- let contentElementsL' = map (setIdx ns "1") contentElementsL -- contentElementsR' = map (setIdx ns "2") contentElementsR - return $ buildSpTree ns spTree $ - hdrShapeElements <> contentElementsL <> contentElementsR -twoColumnToElement _ _ _ _= return $ mknode "p:sp" [] () + return + $ (Just TwoColumnShapeIds{..}, ) + $ buildSpTree ns spTree + $ hdrShapeElements <> contentElementsL <> contentElementsR +twoColumnToElement _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) + +data ComparisonShapeIds = ComparisonShapeIds + { comparisonHeaderId :: Maybe ShapeId + , comparisonLeftTextIds :: [ShapeId] + , comparisonLeftContentIds :: [ShapeId] + , comparisonRightTextIds :: [ShapeId] + , comparisonRightContentIds :: [ShapeId] + } comparisonToElement :: PandocMonad m => @@ -1365,33 +1431,46 @@ comparisonToElement :: [ParaElem] -> ([Shape], [Shape]) -> ([Shape], [Shape]) -> - P m Element + P m (Maybe ComparisonShapeIds, Element) comparisonToElement layout hdrShape (shapesL1, shapesL2) (shapesR1, shapesR2) | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - element <- nonBodyTextToElement layout [PHType "title"] hdrShape + (headerShapeId, element) <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] - contentElementsL1 <- local - (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) - (shapesToElements layout shapesL1) - contentElementsL2 <- local - (\env -> env {envPlaceholder = Placeholder ObjType 0}) - (shapesToElements layout shapesL2) - contentElementsR1 <- local - (\env -> env {envPlaceholder = Placeholder (PHType "body") 1}) - (shapesToElements layout shapesR1) - contentElementsR2 <- local - (\env -> env {envPlaceholder = Placeholder ObjType 1}) - (shapesToElements layout shapesR2) - return $ buildSpTree ns spTree $ - mconcat [ hdrShapeElements - , contentElementsL1 - , contentElementsL2 - , contentElementsR1 - , contentElementsR2 - ] -comparisonToElement _ _ _ _= return $ mknode "p:sp" [] () + comparisonHeaderId = if null hdrShape then Nothing else headerShapeId + contentL1 <- local (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) + (shapesToElements layout shapesL1) + let comparisonLeftTextIds = mapMaybe fst contentL1 + contentElementsL1 = snd <$> contentL1 + contentL2 <- local (\env -> env {envPlaceholder = Placeholder ObjType 0}) + (shapesToElements layout shapesL2) + let comparisonLeftContentIds = mapMaybe fst contentL2 + contentElementsL2 = snd <$> contentL2 + contentR1 <- local (\env -> env {envPlaceholder = Placeholder (PHType "body") 1}) + (shapesToElements layout shapesR1) + let comparisonRightTextIds = mapMaybe fst contentR1 + contentElementsR1 = snd <$> contentR1 + contentR2 <- local (\env -> env {envPlaceholder = Placeholder ObjType 1}) + (shapesToElements layout shapesR2) + let comparisonRightContentIds = mapMaybe fst contentR2 + contentElementsR2 = snd <$> contentR2 + return + $ (Just ComparisonShapeIds{..}, ) + $ buildSpTree ns spTree + $ mconcat [ hdrShapeElements + , contentElementsL1 + , contentElementsL2 + , contentElementsR1 + , contentElementsR2 + ] +comparisonToElement _ _ _ _= return (Nothing, mknode "p:sp" [] ()) + +data ContentWithCaptionShapeIds = ContentWithCaptionShapeIds + { contentWithCaptionHeaderId :: Maybe ShapeId + , contentWithCaptionCaptionIds :: [ShapeId] + , contentWithCaptionContentIds :: [ShapeId] + } contentWithCaptionToElement :: PandocMonad m => @@ -1399,25 +1478,30 @@ contentWithCaptionToElement :: [ParaElem] -> [Shape] -> [Shape] -> - P m Element + P m (Maybe ContentWithCaptionShapeIds, Element) contentWithCaptionToElement layout hdrShape textShapes contentShapes | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - element <- nonBodyTextToElement layout [PHType "title"] hdrShape + (shapeId, element) <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] - textElements <- local - (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) - (shapesToElements layout textShapes) - contentElements <- local - (\env -> env {envPlaceholder = Placeholder ObjType 0}) - (shapesToElements layout contentShapes) - return $ buildSpTree ns spTree $ - mconcat [ hdrShapeElements - , textElements - , contentElements - ] -contentWithCaptionToElement _ _ _ _ = return $ mknode "p:sp" [] () + contentWithCaptionHeaderId = if null hdrShape then Nothing else shapeId + text <- local (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) + (shapesToElements layout textShapes) + let contentWithCaptionCaptionIds = mapMaybe fst text + textElements = snd <$> text + content <- local (\env -> env {envPlaceholder = Placeholder ObjType 0}) + (shapesToElements layout contentShapes) + let contentWithCaptionContentIds = mapMaybe fst content + contentElements = snd <$> content + return + $ (Just ContentWithCaptionShapeIds{..}, ) + $ buildSpTree ns spTree + $ mconcat [ hdrShapeElements + , textElements + , contentElements + ] +contentWithCaptionToElement _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) blankToElement :: PandocMonad m => @@ -1430,73 +1514,116 @@ blankToElement layout return $ buildSpTree ns spTree [] blankToElement _ = return $ mknode "p:sp" [] () -titleToElement :: PandocMonad m => Element -> [ParaElem] -> P m Element +newtype TitleShapeIds = TitleShapeIds + { titleHeaderId :: Maybe ShapeId + } + +titleToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + P m (Maybe TitleShapeIds, Element) titleToElement layout titleElems | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - element <- nonBodyTextToElement layout [PHType "title", PHType "ctrTitle"] titleElems + (shapeId, element) <- nonBodyTextToElement layout [PHType "title", PHType "ctrTitle"] titleElems let titleShapeElements = [Elem element | not (null titleElems)] - return $ buildSpTree ns spTree titleShapeElements -titleToElement _ _ = return $ mknode "p:sp" [] () + titleHeaderId = if null titleElems then Nothing else shapeId + return $ (Just TitleShapeIds{..}, ) $ buildSpTree ns spTree titleShapeElements +titleToElement _ _ = return (Nothing, mknode "p:sp" [] ()) + +data MetadataShapeIds = MetadataShapeIds + { metadataTitleId :: Maybe ShapeId + , metadataSubtitleId :: Maybe ShapeId + , metadataDateId :: Maybe ShapeId + } -metadataToElement :: PandocMonad m => Element -> [ParaElem] -> [ParaElem] -> [[ParaElem]] -> [ParaElem] -> P m Element +metadataToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + [ParaElem] -> + [[ParaElem]] -> + [ParaElem] -> + P m (Maybe MetadataShapeIds, Element) metadataToElement layout titleElems subtitleElems authorsElems dateElems | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - titleShapeElements <- if null titleElems - then return [] - else sequence [nonBodyTextToElement layout [PHType "ctrTitle"] titleElems] let combinedAuthorElems = intercalate [Break] authorsElems subtitleAndAuthorElems = intercalate [Break, Break] [subtitleElems, combinedAuthorElems] - subtitleShapeElements <- if null subtitleAndAuthorElems - then return [] - else sequence [nonBodyTextToElement layout [PHType "subTitle"] subtitleAndAuthorElems] - dateShapeElements <- if null dateElems - then return [] - else sequence [nonBodyTextToElement layout [PHType "dt"] dateElems] - return . buildSpTree ns spTree . map Elem $ - (titleShapeElements <> subtitleShapeElements <> dateShapeElements) -metadataToElement _ _ _ _ _ = return $ mknode "p:sp" [] () + (titleId, titleElement) <- nonBodyTextToElement layout [PHType "ctrTitle"] titleElems + (subtitleId, subtitleElement) <- nonBodyTextToElement layout [PHType "subTitle"] subtitleAndAuthorElems + (dateId, dateElement) <- nonBodyTextToElement layout [PHType "dt"] dateElems + let titleShapeElements = [titleElement | not (null titleElems)] + metadataTitleId = if null titleElems then Nothing else titleId + subtitleShapeElements = [subtitleElement | not (null subtitleAndAuthorElems)] + metadataSubtitleId = if null subtitleAndAuthorElems then Nothing else subtitleId + dateShapeElements = [dateElement | not (null dateElems)] + metadataDateId = if null dateElems then Nothing else dateId + return + $ (Just MetadataShapeIds{..}, ) + $ buildSpTree ns spTree + $ map Elem + $ titleShapeElements <> subtitleShapeElements <> dateShapeElements +metadataToElement _ _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) slideToElement :: PandocMonad m => Slide -> P m Element slideToElement (Slide _ l@(ContentSlide hdrElems shapes) _ )= do layout <- getLayout l - spTree <- local (\env -> if null hdrElems - then env - else env{envSlideHasHeader=True}) $ - contentToElement layout hdrElems shapes + (shapeIds, spTree) + <- local (\env -> if null hdrElems + then env + else env{envSlideHasHeader=True}) + (contentToElement layout hdrElems shapes) + let animations = case shapeIds of + Nothing -> [] + Just ContentShapeIds{..} -> + slideToIncrementalAnimations (zip contentContentIds shapes) return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] + ] (mknode "p:cSld" [] [spTree] : animations) slideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _) = do layout <- getLayout l - spTree <- local (\env -> if null hdrElems + (shapeIds, spTree) <- local (\env -> if null hdrElems then env else env{envSlideHasHeader=True}) $ twoColumnToElement layout hdrElems shapesL shapesR + let animations = case shapeIds of + Nothing -> [] + Just TwoColumnShapeIds{..} -> + slideToIncrementalAnimations (zip twoColumnLeftIds shapesL + <> zip twoColumnRightIds shapesR) return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] + ] (mknode "p:cSld" [] [spTree] : animations) slideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _) = do layout <- getLayout l - spTree <- local (\env -> if null hdrElems + (shapeIds, spTree) <- local (\env -> if null hdrElems then env else env{envSlideHasHeader=True}) $ comparisonToElement layout hdrElems shapesL shapesR + let animations = case shapeIds of + Nothing -> [] + Just ComparisonShapeIds{..} -> + slideToIncrementalAnimations + (zip comparisonLeftTextIds (fst shapesL) + <> zip comparisonLeftContentIds (snd shapesL) + <> zip comparisonRightTextIds (fst shapesR) + <> zip comparisonRightContentIds (snd shapesR)) return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] + ] (mknode "p:cSld" [] [spTree] : animations) slideToElement (Slide _ l@(TitleSlide hdrElems) _) = do layout <- getLayout l - spTree <- titleToElement layout hdrElems + (_, spTree) <- titleToElement layout hdrElems return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), @@ -1504,7 +1631,7 @@ slideToElement (Slide _ l@(TitleSlide hdrElems) _) = do ] [mknode "p:cSld" [] [spTree]] slideToElement (Slide _ l@(MetadataSlide titleElems subtitleElems authorElems dateElems) _) = do layout <- getLayout l - spTree <- metadataToElement layout titleElems subtitleElems authorElems dateElems + (_, spTree) <- metadataToElement layout titleElems subtitleElems authorElems dateElems return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), @@ -1512,12 +1639,18 @@ slideToElement (Slide _ l@(MetadataSlide titleElems subtitleElems authorElems da ] [mknode "p:cSld" [] [spTree]] slideToElement (Slide _ l@(ContentWithCaptionSlide hdrElems captionShapes contentShapes) _) = do layout <- getLayout l - spTree <- contentWithCaptionToElement layout hdrElems captionShapes contentShapes + (shapeIds, spTree) <- contentWithCaptionToElement layout hdrElems captionShapes contentShapes + let animations = case shapeIds of + Nothing -> [] + Just ContentWithCaptionShapeIds{..} -> + slideToIncrementalAnimations + (zip contentWithCaptionCaptionIds captionShapes + <> zip contentWithCaptionContentIds contentShapes) return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] + ] (mknode "p:cSld" [] [spTree] : animations) slideToElement (Slide _ BlankSlide _) = do layout <- getLayout BlankSlide spTree <- blankToElement layout @@ -1527,6 +1660,27 @@ slideToElement (Slide _ BlankSlide _) = do ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") ] [mknode "p:cSld" [] [spTree]] +slideToIncrementalAnimations :: + [(ShapeId, Shape)] -> + [Element] +slideToIncrementalAnimations shapes = let + incrementals :: [(ShapeId, [Bool])] + incrementals = do + (shapeId, TextBox ps) <- shapes + pure . (shapeId,) $ do + Paragraph ParaProps{pPropIncremental} _ <- ps + pure pPropIncremental + toIndices :: [Bool] -> Maybe (NonEmpty (Integer, Integer)) + toIndices bs = do + let indexed = zip [0..] bs + ts <- nonEmpty (filter snd indexed) + pure (fmap (\(n, _) -> (n, n)) ts) + indices :: [(ShapeId, NonEmpty (Integer, Integer))] + indices = do + (shapeId, bs) <- incrementals + toList ((,) shapeId <$> toIndices bs) + in toList (incrementalAnimation <$> nonEmpty indices) + -------------------------------------------------------------------- -- Notes: @@ -2080,9 +2234,10 @@ presentationToPresentationElement presentationUpdateRIdData pres = do updateRIdAttribute :: XML.Attr -> XML.Attr updateRIdAttribute attr = fromMaybe attr $ do - (oldValue, _) <- case attrKey attr of + oldValue <- case attrKey attr of QName "id" _ (Just "r") -> - T.stripPrefix "rId" (attrVal attr) >>= (hush . decimal) + T.stripPrefix "rId" (attrVal attr) + >>= fmap fromIntegral . readTextAsInteger _ -> Nothing let newValue = updatePresentationRId presentationUpdateRIdData oldValue pure attr {attrVal = "rId" <> T.pack (show newValue)} @@ -2316,3 +2471,102 @@ autoNumAttrs (startNum, numStyle, numDelim) = OneParen -> "ParenR" TwoParens -> "ParenBoth" _ -> "Period" + +-- | The XML required to insert an "appear" animation for each of the given +-- groups of paragraphs, identified by index. +incrementalAnimation :: + -- | (ShapeId, [(startParagraphIndex, endParagraphIndex)]) + NonEmpty (ShapeId, NonEmpty (Integer, Integer)) -> + Element +incrementalAnimation indices = mknode "p:timing" [] [tnLst, bldLst] + where + triples :: NonEmpty (ShapeId, Integer, Integer) + triples = do + (shapeId, paragraphIds) <- indices + (start, end) <- paragraphIds + pure (shapeId, start, end) + + tnLst = mknode "p:tnLst" [] + $ mknode "p:par" [] + $ mknode "p:cTn" [ ("id", "1") + , ("dur", "indefinite") + , ("restart", "never") + , ("nodeType", "tmRoot") + ] + $ mknode "p:childTnLst" [] + $ mknode "p:seq" [ ("concurrent", "1") + , ("nextAc", "seek") + ] + [ mknode "p:cTn" [ ("id", "2") + , ("dur", "indefinite") + , ("nodeType", "mainSeq") + ] + $ mknode "p:childTnLst" [] + $ zipWith makePar [3, 7 ..] (toList triples) + , mknode "p:prevCondLst" [] + $ mknode "p:cond" ([("evt", "onPrev"), ("delay", "0")]) + $ mknode "p:tgtEl" [] + $ mknode "p:sldTgt" [] () + , mknode "p:nextCondLst" [] + $ mknode "p:cond" ([("evt", "onNext"), ("delay", "0")]) + $ mknode "p:tgtEl" [] + $ mknode "p:sldTgt" [] () + ] + bldLst = mknode "p:bldLst" [] + [ mknode "p:bldP" [ ("spid", T.pack (show shapeId)) + , ("grpId", "0") + , ("uiExpand", "1") + , ("build", "p") + ] + () | (shapeId, _) <- toList indices + ] + + makePar :: Integer -> (ShapeId, Integer, Integer) -> Element + makePar nextId (shapeId, start, end) = + mknode "p:par" [] + $ mknode "p:cTn" [("id", T.pack (show nextId)), ("fill", "hold")] + [ mknode "p:stCondLst" [] + $ mknode "p:cond" [("delay", "indefinite")] () + , mknode "p:childTnLst" [] + $ mknode "p:par" [] + $ mknode "p:cTn" [ ("id", T.pack (show (nextId + 1))) + , ("fill", "hold") + ] + [ mknode "p:stCondLst" [] + $ mknode "p:cond" [("delay", "0")] () + , mknode "p:childTnLst" [] + $ mknode "p:par" [] + $ mknode "p:cTn" [ ("id", T.pack (show (nextId + 2))) + , ("presetID", "1") + , ("presetClass", "entr") + , ("presetSubtype", "0") + , ("fill", "hold") + , ("grpId", "0") + , ("nodeType", "clickEffect") + ] + [ mknode "p:stCondLst" [] + $ mknode "p:cond" [("delay", "0")] () + , mknode "p:childTnLst" [] + $ mknode "p:set" [] + [ mknode "p:cBhvr" [] + [ mknode "p:cTn" [ ("id", T.pack (show (nextId + 3))) + , ("dur", "1") + , ("fill", "hold") + ] + $ mknode "p:stCondLst" [] + $ mknode "p:cond" [("delay", "0")] () + , mknode "p:tgtEl" [] + $ mknode "p:spTgt" [("spid", T.pack (show shapeId))] + $ mknode "p:txEl" [] + $ mknode "p:pRg" [ ("st", T.pack (show start)) + , ("end", T.pack (show end))] + () + , mknode "p:attrNameLst" [] + $ mknode "p:attrName" [] ("style.visibility" :: Text) + ] + , mknode "p:to" [] + $ mknode "p:strVal" [("val", "visible")] () + ] + ] + ] + ] diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 015e2cbdd..a7660fc5e 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -1,8 +1,9 @@ +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE ViewPatterns #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE LambdaCase #-} {- | Module : Text.Pandoc.Writers.Powerpoint.Presentation Copyright : Copyright (C) 2017-2020 Jesse Rosenthal @@ -80,6 +81,8 @@ data WriterEnv = WriterEnv { envMetadata :: Meta , envInNoteSlide :: Bool , envCurSlideId :: SlideId , envInSpeakerNotes :: Bool + , envInIncrementalDiv :: Maybe InIncrementalDiv + , envInListInBlockQuote :: Bool } deriving (Show) @@ -94,6 +97,8 @@ instance Default WriterEnv where , envInNoteSlide = False , envCurSlideId = SlideId "Default" , envInSpeakerNotes = False + , envInIncrementalDiv = Nothing + , envInListInBlockQuote = False } @@ -114,6 +119,23 @@ instance Default WriterState where , stSpeakerNotes = mempty } +data InIncrementalDiv + = InIncremental + -- ^ The current content is contained within an "incremental" div. + | InNonIncremental + -- ^ The current content is contained within a "nonincremental" div. + deriving (Show) + +listShouldBeIncremental :: Pres Bool +listShouldBeIncremental = do + incrementalOption <- asks (writerIncremental . envOpts) + inIncrementalDiv <- asks envInIncrementalDiv + inBlockQuote <- asks envInListInBlockQuote + let toBoolean = (\case InIncremental -> True + InNonIncremental -> False) + maybeInvert = if inBlockQuote then not else id + pure (maybeInvert (maybe incrementalOption toBoolean inIncrementalDiv)) + metadataSlideId :: SlideId metadataSlideId = SlideId "Metadata" @@ -227,7 +249,7 @@ data Graphic = Tbl TableProps [TableCell] [[TableCell]] data Paragraph = Paragraph { paraProps :: ParaProps - , paraElems :: [ParaElem] + , paraElems :: [ParaElem] } deriving (Show, Eq) data BulletType = Bullet @@ -244,6 +266,7 @@ data ParaProps = ParaProps { pPropMarginLeft :: Maybe Pixels , pPropAlign :: Maybe Algnment , pPropSpaceBefore :: Maybe Pixels , pPropIndent :: Maybe Pixels + , pPropIncremental :: Bool } deriving (Show, Eq) instance Default ParaProps where @@ -254,6 +277,7 @@ instance Default ParaProps where , pPropAlign = Nothing , pPropSpaceBefore = Nothing , pPropIndent = Just 0 + , pPropIncremental = False } newtype TeXString = TeXString {unTeXString :: T.Text} @@ -449,7 +473,8 @@ blockToParagraphs (CodeBlock attr str) = do -- (BlockQuote List) as a list to maintain compatibility with other -- formats. blockToParagraphs (BlockQuote (blk : blks)) | isListType blk = do - ps <- blockToParagraphs blk + ps <- local (\env -> env { envInListInBlockQuote = True }) + (blockToParagraphs blk) ps' <- blockToParagraphs $ BlockQuote blks return $ ps ++ ps' blockToParagraphs (BlockQuote blks) = @@ -474,25 +499,30 @@ blockToParagraphs (Header _ (ident, _, _) ils) = do return [Paragraph def{pPropSpaceBefore = Just 30} parElems] blockToParagraphs (BulletList blksLst) = do pProps <- asks envParaProps + incremental <- listShouldBeIncremental let lvl = pPropLevel pProps local (\env -> env{ envInList = True , envParaProps = pProps{ pPropLevel = lvl + 1 , pPropBullet = Just Bullet , pPropMarginLeft = Nothing , pPropIndent = Nothing + , pPropIncremental = incremental }}) $ concatMapM multiParBullet blksLst blockToParagraphs (OrderedList listAttr blksLst) = do pProps <- asks envParaProps + incremental <- listShouldBeIncremental let lvl = pPropLevel pProps local (\env -> env{ envInList = True , envParaProps = pProps{ pPropLevel = lvl + 1 , pPropBullet = Just (AutoNumbering listAttr) , pPropMarginLeft = Nothing , pPropIndent = Nothing + , pPropIncremental = incremental }}) $ concatMapM multiParBullet blksLst blockToParagraphs (DefinitionList entries) = do + incremental <- listShouldBeIncremental let go :: ([Inline], [[Block]]) -> Pres [Paragraph] go (ils, blksLst) = do term <-blockToParagraphs $ Para [Strong ils] @@ -500,8 +530,17 @@ blockToParagraphs (DefinitionList entries) = do -- blockquote. We can extend this further later. definition <- concatMapM (blockToParagraphs . BlockQuote) blksLst return $ term ++ definition - concatMapM go entries -blockToParagraphs (Div _ blks) = concatMapM blockToParagraphs blks + local (\env -> env {envParaProps = + (envParaProps env) {pPropIncremental = incremental}}) + $ concatMapM go entries +blockToParagraphs (Div (_, classes, _) blks) = let + hasIncremental = "incremental" `elem` classes + hasNonIncremental = "nonincremental" `elem` classes + incremental = if | hasIncremental -> Just InIncremental + | hasNonIncremental -> Just InNonIncremental + | otherwise -> Nothing + addIncremental env = env { envInIncrementalDiv = incremental } + in local addIncremental (concatMapM blockToParagraphs blks) blockToParagraphs blk = do addLogMessage $ BlockNotRendered blk return [] diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index dd3846fef..6eb8c7f67 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -232,4 +232,12 @@ tests = groupPptxTests [ pptxTests "Inline formatting" def "pptx/blanks/nbsp-in-heading/input.native" "pptx/blanks/nbsp-in-heading/output.pptx" + , pptxTests ("Incremental lists are supported") + def { writerIncremental = True } + "pptx/incremental-lists/with-flag/input.native" + "pptx/incremental-lists/with-flag/output.pptx" + , pptxTests ("One-off incremental lists are supported") + def + "pptx/incremental-lists/without-flag/input.native" + "pptx/incremental-lists/without-flag/output.pptx" ] diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx new file mode 100644 index 000000000..5a74826a4 Binary files /dev/null and b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/input.native b/test/pptx/incremental-lists/with-flag/input.native new file mode 100644 index 000000000..b690794dc --- /dev/null +++ b/test/pptx/incremental-lists/with-flag/input.native @@ -0,0 +1,139 @@ +[Header 1 ("slide-1-content",[],[]) [Str "Slide",Space,Str "1",Space,Str "(Content)"] +,BulletList + [[Plain [Str "These"]] + ,[Plain [Str "bullets"]] + ,[Plain [Str "should"]] + ,[Plain [Str "be"]] + ,[Plain [Str "incremental"]]] +,Header 1 ("slide-2-content",[],[]) [Str "Slide",Space,Str "2",Space,Str "(Content)"] +,BulletList + [[Para [Str "as"]] + ,[Para [Str "should"]] + ,[Para [Str "these"]]] +,Header 1 ("slide-3-content",[],[]) [Str "Slide",Space,Str "3",Space,Str "(Content)"] +,Para [Str "Even",Space,Str "with",Space,Str "some",Space,Str "text",Space,Str "first,",Space,Str "these",Space,Str "should:"] +,BulletList + [[Plain [Str "also"]] + ,[Plain [Str "be"]] + ,[Plain [Str "incremental"]]] +,Header 1 ("slide-4-content",[],[]) [Str "Slide",Space,Str "4",Space,Str "(Content)"] +,OrderedList (1,Decimal,Period) + [[Plain [Str "These"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]]] +,Para [Str "But",Space,Str "this",Space,Str "text",Space,Str "isn\8217t"] +,BulletList + [[Plain [Str "But"]] + ,[Plain [Str "these"]] + ,[Plain [Str "are"]]] +,Header 1 ("slide-5-two-content",[],[]) [Str "Slide",Space,Str "5",Space,Str "(Two",Space,Str "Content)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "left:"] + ,BulletList + [[Plain [Str "one"]] + ,[Plain [Str "by"]] + ,[Plain [Str "one"]]] + ,Para [Str "With",Space,Str "something",Space,Str "below"]] + ,Div ("",["column"],[]) + [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "right:"] + ,BulletList + [[Plain [Str "one"]] + ,[Plain [Str "by"]] + ,[Plain [Str "one"]]] + ,Para [Str "With",Space,Str "something",Space,Str "else",Space,Str "below"]]] +,Header 1 ("slide-6-two-content-right",[],[]) [Str "Slide",Space,Str "6",Space,Str "(Two",Space,Str "Content",Space,Str "Right)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [BulletList + [[Plain [Str "An"]] + ,[Plain [Str "Incremental"]] + ,[Plain [Str "List"]]]]] +,Header 1 ("slide-7-content-with-caption",[],[]) [Str "Slide",Space,Str "7",Space,Str "(Content",Space,Str "with",Space,Str "Caption)"] +,Para [Str "First,",Space,Str "we",Space,Str "have",Space,Str "some",Space,Str "incremental",Space,Str "bullets:"] +,BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]] +,Para [Str "Then,",Space,Str "a",Space,Str "picture:"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")] +,Header 1 ("slide-8-comparison",[],[]) [Str "Slide",Space,Str "8",Space,Str "(Comparison)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]] + ,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [OrderedList (1,Decimal,Period) + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "2"]]]])] + (TableFoot ("",[],[]) + [])]] +,Header 1 ("slide-9-content",[],[]) [Str "Slide",Space,Str "9",Space,Str "(Content)"] +,Div ("",["nonincremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "not"]] + ,[Plain [Str "incremental"]]]] +,BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]]] +,Header 1 ("slide-10-content",[],[]) [Str "Slide",Space,Str "10",Space,Str "(Content)"] +,Div ("",["incremental","nonincremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]] + ,[Plain [Str "(the",Space,Str "incremental",Space,Str "class",Space,Str "wins)"]]]] +,Header 1 ("slide-11-content",[],[]) [Str "Slide",Space,Str "11",Space,Str "(Content)"] +,Para [Str "These",Space,Str "bullets",Space,Str "are",Space,Str "not",Space,Str "incremental:"] +,BlockQuote + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]] +,Para [Str "These",Space,Str "are:"] +,Div ("",["nonincremental"],[]) + [BlockQuote + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]]] +,Para [Str "These",Space,Str "are",Space,Str "not:"] +,BlockQuote + [Div ("",["nonincremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]]] +,Header 1 ("slide-12-content",[],[]) [Str "Slide",Space,Str "12",Space,Str "(Content)"] +,Div ("",["nonincremental"],[]) + [Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]]]]] +,Div ("",["incremental"],[]) + [Div ("",["nonincremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "not"]]]]]] diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx new file mode 100644 index 000000000..f20dd2906 Binary files /dev/null and b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx new file mode 100644 index 000000000..d4f76f1e7 Binary files /dev/null and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx new file mode 100644 index 000000000..f5ee2ff5f Binary files /dev/null and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx new file mode 100644 index 000000000..16bd85ffd Binary files /dev/null and b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/input.native b/test/pptx/incremental-lists/without-flag/input.native new file mode 100644 index 000000000..87a4aea7e --- /dev/null +++ b/test/pptx/incremental-lists/without-flag/input.native @@ -0,0 +1,137 @@ +[Header 1 ("slide-1-content",[],[]) [Str "Slide",Space,Str "1",Space,Str "(Content)"] +,Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "These"]] + ,[Plain [Str "bullets"]] + ,[Plain [Str "should"]] + ,[Plain [Str "be"]] + ,[Plain [Str "incremental"]]]] +,Header 1 ("slide-2-content",[],[]) [Str "Slide",Space,Str "2",Space,Str "(Content)"] +,BulletList + [[Plain [Str "These"]] + ,[Plain [Str "are"]] + ,[Plain [Str "not"]]] +,Header 1 ("slide-3-content",[],[]) [Str "Slide",Space,Str "3",Space,Str "(Content)"] +,Para [Str "Even",Space,Str "with",Space,Str "some",Space,Str "text",Space,Str "first,",Space,Str "these",Space,Str "should:"] +,Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "also"]] + ,[Plain [Str "be"]] + ,[Plain [Str "incremental"]]]] +,Header 1 ("slide-4-content",[],[]) [Str "Slide",Space,Str "4",Space,Str "(Content)"] +,Div ("",["incremental"],[]) + [OrderedList (1,Decimal,Period) + [[Plain [Str "These"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]]]] +,Para [Str "But",Space,Str "this",Space,Str "text",Space,Str "isn\8217t"] +,Header 1 ("slide-5-two-content",[],[]) [Str "Slide",Space,Str "5",Space,Str "(Two",Space,Str "Content)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "left:"] + ,Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "by"]] + ,[Plain [Str "one"]]]] + ,Para [Str "With",Space,Str "something",Space,Str "below"]] + ,Div ("",["column"],[]) + [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "right:"] + ,Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "by"]] + ,[Plain [Str "one"]]]] + ,BulletList + [[Plain [Str "already"]] + ,[Plain [Str "here"]] + ,[Plain [Str "though"]]]]] +,Header 1 ("slide-6-two-content-right",[],[]) [Str "Slide",Space,Str "6",Space,Str "(Two",Space,Str "Content",Space,Str "Right)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "An"]] + ,[Plain [Str "Incremental"]] + ,[Plain [Str "List"]]]]]] +,Header 1 ("slide-7-content-with-caption",[],[]) [Str "Slide",Space,Str "7",Space,Str "(Content",Space,Str "with",Space,Str "Caption)"] +,Para [Str "First,",Space,Str "we",Space,Str "have",Space,Str "some",Space,Str "incremental",Space,Str "bullets:"] +,Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]] +,Para [Str "Then,",Space,Str "a",Space,Str "picture:"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")] +,Header 1 ("slide-8-comparison",[],[]) [Str "Slide",Space,Str "8",Space,Str "(Comparison)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]] + ,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [Div ("",["incremental"],[]) + [OrderedList (1,Decimal,Period) + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "2"]]]])] + (TableFoot ("",[],[]) + [])]] +,Header 1 ("slide-10-content",[],[]) [Str "Slide",Space,Str "10",Space,Str "(Content)"] +,Div ("",["incremental","nonincremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]] + ,[Plain [Str "(the",Space,Str "incremental",Space,Str "class",Space,Str "wins)"]]]] +,Header 1 ("slide-11-content",[],[]) [Str "Slide",Space,Str "11",Space,Str "(Content)"] +,Para [Str "These",Space,Str "bullets",Space,Str "are",Space,Str "incremental:"] +,BlockQuote + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]] +,Para [Str "These",Space,Str "are",Space,Str "not:"] +,Div ("",["incremental"],[]) + [BlockQuote + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]]] +,Para [Str "These",Space,Str "are:"] +,BlockQuote + [Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]]] +,Header 1 ("slide-12-content",[],[]) [Str "Slide",Space,Str "12",Space,Str "(Content)"] +,Div ("",["nonincremental"],[]) + [Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]]]]] +,Div ("",["incremental"],[]) + [Div ("",["nonincremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "not"]]]]]] diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx new file mode 100644 index 000000000..054fe918e Binary files /dev/null and b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx new file mode 100644 index 000000000..1b326461d Binary files /dev/null and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx new file mode 100644 index 000000000..dee6e9b06 Binary files /dev/null and b/test/pptx/incremental-lists/without-flag/templated.pptx differ -- cgit v1.2.3 From 7c22c0202e8ed706d33f301e65f0aa1a847b4ec4 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Mon, 13 Sep 2021 18:16:19 +0100 Subject: pptx: Support specifying slide background images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the reveal-js output, it’s possible to use reveal’s `data-background-image` class on a slide’s title to specify a background image for the slide. With this commit, it’s possible to use `background-image` in the same way for pptx output. Only the “stretch” mode is supported, and the background image is centred around the slide in the image’s larger axis, matching the observed default behaviour of PowerPoint. - Support `background-image` per slide. - Add tests. - Update manual. --- MANUAL.txt | 69 +++++++----- pandoc.cabal | 2 + src/Text/Pandoc/Writers/Powerpoint/Output.hs | 117 ++++++++++++++++----- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 29 +++-- test/Tests/Writers/Powerpoint.hs | 4 + test/pptx/background-image/deleted-layouts.pptx | Bin 0 -> 56282 bytes test/pptx/background-image/input.native | 17 +++ test/pptx/background-image/moved-layouts.pptx | Bin 0 -> 66987 bytes test/pptx/background-image/output.pptx | Bin 0 -> 53408 bytes test/pptx/background-image/templated.pptx | Bin 0 -> 66487 bytes 10 files changed, 178 insertions(+), 60 deletions(-) create mode 100644 test/pptx/background-image/deleted-layouts.pptx create mode 100644 test/pptx/background-image/input.native create mode 100644 test/pptx/background-image/moved-layouts.pptx create mode 100644 test/pptx/background-image/output.pptx create mode 100644 test/pptx/background-image/templated.pptx (limited to 'test/pptx') diff --git a/MANUAL.txt b/MANUAL.txt index 82fc21684..98a2f4299 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -6054,40 +6054,61 @@ the [Beamer User's Guide] may also be used: `allowdisplaybreaks`, `allowframebreaks`, `b`, `c`, `t`, `environment`, `label`, `plain`, `shrink`, `standout`, `noframenumbering`. -## Background in reveal.js and beamer +## Background in reveal.js, beamer, and pptx -Background images can be added to self-contained reveal.js slide shows and -to beamer slide shows. +Background images can be added to self-contained reveal.js slide shows, +beamer slide shows, and pptx slide shows. -For the same image on every slide, use the configuration -option `background-image` either in the YAML metadata block -or as a command-line variable. (There are no other options in -beamer and the rest of this section concerns reveal.js slide shows.) +### On all slides (beamer, reveal.js, pptx) -For reveal.js, you can instead use the reveal.js-native option -`parallaxBackgroundImage`. You can also set `parallaxBackgroundHorizontal` -and `parallaxBackgroundVertical` the same way and must also set -`parallaxBackgroundSize` to have your values take effect. +With beamer and reveal.js, the configuration option `background-image` can be +used either in the YAML metadata block or as a command-line variable to get the +same image on every slide. -To set an image for a particular reveal.js slide, add -`{data-background-image="/path/to/image"}` -to the first slide-level heading on the slide (which may even be empty). +For pptx, you can use a [reference doc](#option--reference-doc) in which +background images have been set on the [relevant +layouts](#powerpoint-layout-choice). + +#### `parallaxBackgroundImage` (reveal.js) + +For reveal.js, there is also the reveal.js-native option +`parallaxBackgroundImage`, which can be used instead of `background-image` to +produce a parallax scrolling background. You must also set +`parallaxBackgroundSize`, and can optionally set `parallaxBackgroundHorizontal` +and `parallaxBackgroundVertical` to configure the scrolling behaviour. See the +[reveal.js documentation](https://revealjs.com/backgrounds/#parallax-background) +for more details about the meaning of these options. In reveal.js's overview mode, the parallaxBackgroundImage will show up only on the first slide. -Other reveal.js background settings also work on individual slides, including -`data-background-size`, `data-background-repeat`, `data-background-color`, -`data-transition`, and `data-transition-speed`. +### On individual slides (reveal.js, pptx) + +To set an image for a particular reveal.js or pptx slide, add +`{background-image="/path/to/image"}` to the first slide-level heading on the +slide (which may even be empty). + +As the [HTML writers pass unknown attributes +through](#extension-link_attributes), other reveal.js background settings also +work on individual slides, including `background-size`, `background-repeat`, +`background-color`, `transition`, and `transition-speed`. (The `data-` prefix +will automatically be added.) + +Note: `data-background-image` is also supported in pptx for consistency with +reveal.js – if `background-image` isn’t found, `data-background-image` will be +checked. + +### On the title slide (reveal.js, pptx) -To add a background image to the automatically generated title slide, use the -`title-slide-attributes` variable in the YAML metadata block. It must contain -a map of attribute names and values. +To add a background image to the automatically generated title slide for +reveal.js, use the `title-slide-attributes` variable in the YAML metadata block. +It must contain a map of attribute names and values. (Note that the `data-` +prefix is required here, as it isn’t added automatically.) -See the [reveal.js documentation](https://revealjs.com/backgrounds/) for more -details. +For pptx, pass a [reference doc](#option--reference-doc) with the background +image set on the “Title Slide” layout. -For example in reveal.js: +### Example (reveal.js) ``` --- @@ -6102,7 +6123,7 @@ title-slide-attributes: Slide 1 has background_image.png as its background. -## {data-background-image="/path/to/special_image.jpg"} +## {background-image="/path/to/special_image.jpg"} Slide 2 has a special image for its background, even though the heading has no content. ``` diff --git a/pandoc.cabal b/pandoc.cabal index 6fcc384f9..0c8cf0d61 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -380,6 +380,8 @@ extra-source-files: test/rtf/*.native test/rtf/*.rtf test/pptx/*.pptx + test/pptx/background-image/input.native + test/pptx/background-image/*.pptx test/pptx/blanks/just-speaker-notes/input.native test/pptx/blanks/just-speaker-notes/*.pptx test/pptx/blanks/nbsp-in-body/input.native diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 5eadf1312..1431469d3 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -31,6 +31,7 @@ import qualified Data.CaseInsensitive as CI import Data.Default import Data.Foldable (toList) import Data.List.NonEmpty (nonEmpty, NonEmpty ((:|))) +import Data.Ratio ((%), Ratio) import Data.Text (Text) import qualified Data.Text as T import Data.Text.Read (decimal) @@ -439,9 +440,9 @@ makeSpeakerNotesMap :: Presentation -> M.Map Int Int makeSpeakerNotesMap (Presentation _ slides) = M.fromList $ mapMaybe f (slides `zip` [1..]) `zip` [1..] - where f (Slide _ _ notes, n) = if notes == mempty - then Nothing - else Just n + where f (Slide _ _ notes _, n) = if notes == mempty + then Nothing + else Just n presentationToArchive :: PandocMonad m => WriterOptions -> Meta -> Presentation -> m Archive @@ -1570,8 +1571,9 @@ metadataToElement layout titleElems subtitleElems authorsElems dateElems metadataToElement _ _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) slideToElement :: PandocMonad m => Slide -> P m Element -slideToElement (Slide _ l@(ContentSlide hdrElems shapes) _ )= do +slideToElement (Slide _ l@(ContentSlide hdrElems shapes) _ backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (shapeIds, spTree) <- local (\env -> if null hdrElems then env @@ -1585,9 +1587,10 @@ slideToElement (Slide _ l@(ContentSlide hdrElems shapes) _ )= do [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] (mknode "p:cSld" [] [spTree] : animations) -slideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _) = do + ] (mknode "p:cSld" [] (toList backgroundImageElement <> [spTree]) : animations) +slideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _ backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (shapeIds, spTree) <- local (\env -> if null hdrElems then env else env{envSlideHasHeader=True}) $ @@ -1601,9 +1604,10 @@ slideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _) = do [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] (mknode "p:cSld" [] [spTree] : animations) -slideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _) = do + ] (mknode "p:cSld" [] (toList backgroundImageElement <> [spTree]) : animations) +slideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _ backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (shapeIds, spTree) <- local (\env -> if null hdrElems then env else env{envSlideHasHeader=True}) $ @@ -1620,25 +1624,36 @@ slideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _) = do [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] (mknode "p:cSld" [] [spTree] : animations) -slideToElement (Slide _ l@(TitleSlide hdrElems) _) = do + ] (mknode "p:cSld" [] (toList backgroundImageElement <> [spTree]) : animations) +slideToElement (Slide _ l@(TitleSlide hdrElems) _ backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (_, spTree) <- titleToElement layout hdrElems return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] -slideToElement (Slide _ l@(MetadataSlide titleElems subtitleElems authorElems dateElems) _) = do + ] [mknode "p:cSld" [] (toList backgroundImageElement <> [spTree])] +slideToElement (Slide + _ + l@(MetadataSlide titleElems subtitleElems authorElems dateElems) + _ + backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (_, spTree) <- metadataToElement layout titleElems subtitleElems authorElems dateElems return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] -slideToElement (Slide _ l@(ContentWithCaptionSlide hdrElems captionShapes contentShapes) _) = do + ] [mknode "p:cSld" [] (toList backgroundImageElement <> [spTree])] +slideToElement (Slide + _ + l@(ContentWithCaptionSlide hdrElems captionShapes contentShapes) + _ + backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (shapeIds, spTree) <- contentWithCaptionToElement layout hdrElems captionShapes contentShapes let animations = case shapeIds of Nothing -> [] @@ -1650,15 +1665,63 @@ slideToElement (Slide _ l@(ContentWithCaptionSlide hdrElems captionShapes conten [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] (mknode "p:cSld" [] [spTree] : animations) -slideToElement (Slide _ BlankSlide _) = do + ] (mknode "p:cSld" [] (toList backgroundImageElement <> [spTree]) : animations) +slideToElement (Slide _ BlankSlide _ backgroundImage) = do layout <- getLayout BlankSlide + backgroundImageElement <- traverse backgroundImageToElement backgroundImage spTree <- blankToElement layout return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] + ] [mknode "p:cSld" [] (toList backgroundImageElement <> [spTree])] + +backgroundImageToElement :: PandocMonad m => FilePath -> P m Element +backgroundImageToElement path = do + MediaInfo{mInfoLocalId, mInfoFilePath} <- registerMedia path [] + (imgBytes, _) <- P.fetchItem (T.pack mInfoFilePath) + opts <- asks envOpts + let imageDimensions = either (const Nothing) + (Just . sizeInPixels) + (imageSize opts imgBytes) + pageSize <- asks envPresentationSize + let fillRectAttributes = maybe [] (offsetAttributes pageSize) imageDimensions + let rId = "rId" <> T.pack (show mInfoLocalId) + return + $ mknode "p:bg" [] + $ mknode "p:bgPr" [] + [ mknode "a:blipFill" [("dpi", "0"), ("rotWithShape", "1")] + [ mknode "a:blip" [("r:embed", rId)] + $ mknode "a:lum" [] () + , mknode "a:srcRect" [] () + , mknode "a:stretch" [] + $ mknode "a:fillRect" fillRectAttributes () + ] + , mknode "a:effectsLst" [] () + ] + where + offsetAttributes :: (Integer, Integer) -> (Integer, Integer) -> [(Text, Text)] + offsetAttributes (pageWidth, pageHeight) (pictureWidth, pictureHeight) = let + widthRatio = pictureWidth % pageWidth + heightRatio = pictureHeight % pageHeight + getOffset :: Ratio Integer -> Text + getOffset proportion = let + percentageOffset = (proportion - 1) * (-100 % 2) + integerOffset = round percentageOffset * 1000 :: Integer + in T.pack (show integerOffset) + in case compare widthRatio heightRatio of + EQ -> [] + LT -> let + offset = getOffset ((pictureHeight % pageHeight) / widthRatio) + in [ ("t", offset) + , ("b", offset) + ] + GT -> let + offset = getOffset ((pictureWidth % pageWidth) / heightRatio) + in [ ("l", offset) + , ("r", offset) + ] + slideToIncrementalAnimations :: [(ShapeId, Shape)] -> @@ -1790,8 +1853,8 @@ speakerNotesSlideNumber pgNum fieldId = ] slideToSpeakerNotesElement :: PandocMonad m => Slide -> P m (Maybe Element) -slideToSpeakerNotesElement (Slide _ _ (SpeakerNotes [])) = return Nothing -slideToSpeakerNotesElement slide@(Slide _ _ (SpeakerNotes paras)) = do +slideToSpeakerNotesElement (Slide _ _ (SpeakerNotes []) _) = return Nothing +slideToSpeakerNotesElement slide@(Slide _ _ (SpeakerNotes paras) _) = do master <- getNotesMaster fieldId <- getSlideNumberFieldId master num <- slideNum slide @@ -2037,7 +2100,7 @@ slideToSpeakerNotesEntry slide = do _ -> return Nothing slideToSpeakerNotesRelElement :: PandocMonad m => Slide -> P m (Maybe Element) -slideToSpeakerNotesRelElement (Slide _ _ (SpeakerNotes [])) = return Nothing +slideToSpeakerNotesRelElement (Slide _ _ (SpeakerNotes []) _) = return Nothing slideToSpeakerNotesRelElement slide@Slide{} = do idNum <- slideNum slide return $ Just $ @@ -2124,13 +2187,13 @@ slideToSlideRelElement slide = do target <- flip fmap getSlideLayouts $ T.pack . ("../slideLayouts/" <>) . takeFileName . slPath . case slide of - (Slide _ MetadataSlide{} _) -> metadata - (Slide _ TitleSlide{} _) -> title - (Slide _ ContentSlide{} _) -> content - (Slide _ TwoColumnSlide{} _) -> twoColumn - (Slide _ ComparisonSlide{} _) -> comparison - (Slide _ ContentWithCaptionSlide{} _) -> contentWithCaption - (Slide _ BlankSlide _) -> blank + (Slide _ MetadataSlide{} _ _) -> metadata + (Slide _ TitleSlide{} _ _) -> title + (Slide _ ContentSlide{} _ _) -> content + (Slide _ TwoColumnSlide{} _ _) -> twoColumn + (Slide _ ComparisonSlide{} _ _) -> comparison + (Slide _ ContentWithCaptionSlide{} _ _) -> contentWithCaption + (Slide _ BlankSlide _ _) -> blank speakerNotesRels <- maybeToList <$> speakerNotesSlideRelElement slide diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index a7660fc5e..fb4518bd7 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -63,7 +63,7 @@ import Text.Pandoc.Writers.Shared (lookupMetaInlines, lookupMetaBlocks , toLegacyTable) import qualified Data.Map as M import qualified Data.Set as S -import Data.Maybe (maybeToList, fromMaybe, listToMaybe) +import Data.Maybe (maybeToList, fromMaybe, listToMaybe, isNothing) import Text.Pandoc.Highlighting import qualified Data.Text as T import Control.Applicative ((<|>)) @@ -201,6 +201,7 @@ data DocProps = DocProps { dcTitle :: Maybe T.Text data Slide = Slide { slideId :: SlideId , slideLayout :: Layout , slideSpeakerNotes :: SpeakerNotes + , slideBackgroundImage :: Maybe FilePath } deriving (Show, Eq) newtype SlideId = SlideId T.Text @@ -223,7 +224,7 @@ data Layout = MetadataSlide [ParaElem] [ParaElem] [[ParaElem]] [ParaElem] | ComparisonSlide [ParaElem] ([Shape], [Shape]) ([Shape], [Shape]) -- heading left@(text, content) right@(text, content) | ContentWithCaptionSlide [ParaElem] [Shape] [Shape] - -- heading text content + -- heading text content | BlankSlide deriving (Show, Eq) @@ -725,6 +726,7 @@ bodyBlocksToSlide _ (blk : blks) spkNotes sldId (TwoColumnSlide [] shapesL shapesR) spkNotes + Nothing let mkComparison blksL1 blksL2 blksR1 blksR2 = do shapesL1 <- blocksToShapes blksL1 shapesL2 <- blocksToShapes blksL2 @@ -735,6 +737,7 @@ bodyBlocksToSlide _ (blk : blks) spkNotes sldId (ComparisonSlide [] (shapesL1, shapesL2) (shapesR1, shapesR2)) spkNotes + Nothing let (blksL1, blksL2) = break notText blksL (blksR1, blksR2) = break notText blksR if (any null [blksL1, blksL2]) && (any null [blksR1, blksR2]) @@ -744,7 +747,7 @@ bodyBlocksToSlide _ (blk : blks) spkNotes = do sldId <- asks envCurSlideId inNoteSlide <- asks envInNoteSlide let mkSlide s = - Slide sldId s spkNotes + Slide sldId s spkNotes Nothing if inNoteSlide then mkSlide . ContentSlide [] <$> forceFontSize noteSize (blocksToShapes (blk : blks)) @@ -767,14 +770,15 @@ bodyBlocksToSlide _ [] spkNotes = do sldId BlankSlide spkNotes + Nothing blocksToSlide' :: Int -> [Block] -> SpeakerNotes -> Pres Slide -blocksToSlide' lvl (Header n (ident, _, _) ils : blks) spkNotes +blocksToSlide' lvl (Header n (ident, _, attributes) ils : blks) spkNotes | n < lvl = do registerAnchorId ident sldId <- asks envCurSlideId hdr <- inlinesToParElems ils - return $ Slide sldId (TitleSlide hdr) spkNotes + return $ Slide sldId (TitleSlide hdr) spkNotes backgroundImage | n == lvl || lvl == 0 = do registerAnchorId ident hdr <- inlinesToParElems ils @@ -788,7 +792,10 @@ blocksToSlide' lvl (Header n (ident, _, _) ils : blks) spkNotes ContentWithCaptionSlide _ text content -> ContentWithCaptionSlide hdr text content BlankSlide -> if all inlineIsBlank ils then BlankSlide else ContentSlide hdr [] layout' -> layout' - return $ slide{slideLayout = layout} + return $ slide{slideLayout = layout, slideBackgroundImage = backgroundImage} + where + backgroundImage = T.unpack <$> (lookup "background-image" attributes + <|> lookup "data-background-image" attributes) blocksToSlide' lvl blks spkNotes = bodyBlocksToSlide lvl blks spkNotes blockToSpeakerNotes :: Block -> Pres SpeakerNotes @@ -869,12 +876,13 @@ getMetaSlide = do metadataSlideId (MetadataSlide title subtitle authors date) mempty + Nothing addSpeakerNotesToMetaSlide :: Slide -> [Block] -> Pres (Slide, [Block]) -addSpeakerNotesToMetaSlide (Slide sldId layout@MetadataSlide{} spkNotes) blks = +addSpeakerNotesToMetaSlide (Slide sldId layout@MetadataSlide{} spkNotes backgroundImage) blks = do let (ntsBlks, blks') = span isNotesDiv blks spkNotes' <- mconcat <$> mapM blockToSpeakerNotes ntsBlks - return (Slide sldId layout (spkNotes <> spkNotes'), blks') + return (Slide sldId layout (spkNotes <> spkNotes') backgroundImage, blks') addSpeakerNotesToMetaSlide sld blks = return (sld, blks) makeTOCSlide :: [Block] -> Pres Slide @@ -1010,7 +1018,10 @@ emptyLayout layout = case layout of emptySlide :: Slide -> Bool -emptySlide (Slide _ layout notes) = (notes == mempty) && emptyLayout layout +emptySlide (Slide _ layout notes backgroundImage) + = (notes == mempty) + && emptyLayout layout + && isNothing backgroundImage makesBlankSlide :: [Block] -> Bool makesBlankSlide = all blockIsBlank diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 6eb8c7f67..6e676dc37 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -240,4 +240,8 @@ tests = groupPptxTests [ pptxTests "Inline formatting" def "pptx/incremental-lists/without-flag/input.native" "pptx/incremental-lists/without-flag/output.pptx" + , pptxTests "Background images" + def + "pptx/background-image/input.native" + "pptx/background-image/output.pptx" ] diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx new file mode 100644 index 000000000..05d4104b7 Binary files /dev/null and b/test/pptx/background-image/deleted-layouts.pptx differ diff --git a/test/pptx/background-image/input.native b/test/pptx/background-image/input.native new file mode 100644 index 000000000..22b089a95 --- /dev/null +++ b/test/pptx/background-image/input.native @@ -0,0 +1,17 @@ +[Header 1 ("section-header-with-background-image",[],[("background-image","movie.jpg")]) [Str "Section",Space,Str "Header",Space,Str "(with",Space,Str "background",Space,Str "image)"] +,Header 2 ("slide-1",[],[("background-image","lalune.jpg")]) [Str "Slide",Space,Str "1"] +,Para [Str "This",Space,Str "slide",Space,Str "has",Space,Str "a",Space,Str "moon",Space,Str "background."] +,Header 2 ("slide-2",[],[("background-image","movie.jpg")]) [Str "Slide",Space,Str "2"] +,Para [Str "This",Space,Str "slide",Space,Str "has",Space,Str "a",Space,Str "movie",Space,Str "background."] +,Header 2 ("slide-3",[],[("background-image","movie.jpg")]) [Str "Slide",Space,Str "3"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "Background",Space,Str "images",Space,Str "work",Space,Str "in",Space,Str "two-column",Space,Str "layout."]] + ,Div ("",["column"],[]) + [Para [Str "hello"]]] +,Header 2 ("slide-4",[],[("background-image","movie.jpg")]) [Str "Slide",Space,Str "4"] +,Para [Str "You",Space,Str "can",Space,Str "have",Space,Str "images",Space,Str "on",Space,Str "slides",Space,Str "that",Space,Str "have",Space,Str "background",Space,Str "images:"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")] +,Header 2 ("section",[],[("background-image","lalune.jpg")]) [] +,Div ("",["notes"],[]) + [Para [Str "Blank",Space,Str "slides",Space,Str "can",Space,Str "have",Space,Str "background",Space,Str "images."]]] diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx new file mode 100644 index 000000000..73b69e1d6 Binary files /dev/null and b/test/pptx/background-image/moved-layouts.pptx differ diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx new file mode 100644 index 000000000..9738eefb8 Binary files /dev/null and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/background-image/templated.pptx b/test/pptx/background-image/templated.pptx new file mode 100644 index 000000000..52d304957 Binary files /dev/null and b/test/pptx/background-image/templated.pptx differ -- cgit v1.2.3 From 50adea220d09e445572e94e225fa7a81b3b2bf89 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Tue, 14 Sep 2021 17:07:46 +0100 Subject: pptx: Support footers in the reference doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In PowerPoint, it’s possible to specify footers across all slides, containing a date (optionally automatically updated to today’s date), the slide number (optionally starting from a higher number than 1), and static text. There’s also an option to hide the footer on the title slide. Before this commit, none of that footer content was pulled through from the reference doc: this commit supports all the functionality listed above. There is one behaviour which may not be immediately obvious: if the reference doc specifies a fixed date (i.e. not automatically updating), and there’s a date specified in the metadata for the document, the footer date is replaced by the metadata date. - Include date, slide number, and static footer content from reference doc - Respect “slide number starts from” option - Respect “Don’t show on title slide” option - Add tests --- pandoc.cabal | 5 + src/Text/Pandoc/Writers/Powerpoint/Output.hs | 103 +++++- test/Tests/Writers/Powerpoint.hs | 397 +++++++++++---------- test/pptx/footer/basic/output.pptx | Bin 0 -> 52775 bytes test/pptx/footer/basic/reference.pptx | Bin 0 -> 49063 bytes test/pptx/footer/fixed-date/output.pptx | Bin 0 -> 51397 bytes test/pptx/footer/fixed-date/reference.pptx | Bin 0 -> 47996 bytes test/pptx/footer/higher-slide-number/output.pptx | Bin 0 -> 52790 bytes .../pptx/footer/higher-slide-number/reference.pptx | Bin 0 -> 49082 bytes test/pptx/footer/input.native | 66 ++++ test/pptx/footer/no-title-slide/output.pptx | Bin 0 -> 52362 bytes test/pptx/footer/no-title-slide/reference.pptx | Bin 0 -> 48423 bytes 12 files changed, 372 insertions(+), 199 deletions(-) create mode 100644 test/pptx/footer/basic/output.pptx create mode 100644 test/pptx/footer/basic/reference.pptx create mode 100644 test/pptx/footer/fixed-date/output.pptx create mode 100644 test/pptx/footer/fixed-date/reference.pptx create mode 100644 test/pptx/footer/higher-slide-number/output.pptx create mode 100644 test/pptx/footer/higher-slide-number/reference.pptx create mode 100644 test/pptx/footer/input.native create mode 100644 test/pptx/footer/no-title-slide/output.pptx create mode 100644 test/pptx/footer/no-title-slide/reference.pptx (limited to 'test/pptx') diff --git a/pandoc.cabal b/pandoc.cabal index 0c8cf0d61..4881fe3a4 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -414,6 +414,11 @@ extra-source-files: test/pptx/endnotes-toc/*.pptx test/pptx/endnotes/input.native test/pptx/endnotes/*.pptx + test/pptx/footer/input.native + test/pptx/footer/basic/*.pptx + test/pptx/footer/fixed-date/*.pptx + test/pptx/footer/higher-slide-number/*.pptx + test/pptx/footer/no-title-slide/*.pptx test/pptx/images/input.native test/pptx/images/*.pptx test/pptx/incremental-lists/with-flag/input.native diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 1431469d3..acfd446de 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -2,6 +2,7 @@ {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} +{-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} {- | @@ -159,7 +160,7 @@ data SlideLayoutsOf a = SlideLayouts , comparison :: a , contentWithCaption :: a , blank :: a - } deriving (Show, Functor, Foldable, Traversable) + } deriving (Show, Eq, Functor, Foldable, Traversable) data SlideLayout = SlideLayout { slElement :: Element @@ -197,12 +198,14 @@ data WriterState = WriterState { stLinkIds :: M.Map Int (M.Map Int LinkTarget) -- (FP, Local ID, Global ID, Maybe Mime) , stMediaIds :: M.Map Int [MediaInfo] , stMediaGlobalIds :: M.Map FilePath Int + , stFooterInfo :: Maybe FooterInfo } deriving (Show, Eq) instance Default WriterState where def = WriterState { stLinkIds = mempty , stMediaIds = mempty , stMediaGlobalIds = mempty + , stFooterInfo = Nothing } type P m = ReaderT WriterEnv (StateT WriterState m) @@ -316,8 +319,14 @@ presentationToArchiveP p@(Presentation docProps slides) = do else id let newArch' = foldr f newArch slideLayouts - -- Update the master to make sure it includes any layouts we've just added master <- getMaster + refArchive <- asks envRefArchive + distArchive <- asks envDistArchive + presentationElement <- parseXml refArchive distArchive "ppt/presentation.xml" + modify (\s -> s {stFooterInfo = + getFooterInfo slideLayouts master presentationElement}) + + -- Update the master to make sure it includes any layouts we've just added masterRels <- getMasterRels let (updatedMasterElem, updatedMasterRelElem) = updateMasterElems slideLayouts master masterRels updatedMasterEntry <- elemToEntry "ppt/slideMasters/slideMaster1.xml" updatedMasterElem @@ -432,6 +441,56 @@ updateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels) getIdAttribute (Elem e) = findAttr (QName "id" Nothing Nothing) e getIdAttribute _ = Nothing +data FooterInfo = FooterInfo + { fiDate :: SlideLayoutsOf (Maybe Element) + , fiFooter :: SlideLayoutsOf (Maybe Element) + , fiSlideNumber :: SlideLayoutsOf (Maybe Element) + , fiShowOnFirstSlide :: Bool + } deriving (Show, Eq) + +getFooterInfo :: SlideLayouts -> Element -> Element -> Maybe FooterInfo +getFooterInfo layouts master presentation = do + let ns = elemToNameSpaces master + hf <- findChild (elemName ns "p" "hf") master + let fiDate = getShape "dt" hf . slElement <$> layouts + fiFooter = getShape "ftr" hf . slElement <$> layouts + fiSlideNumber = getShape "sldNum" hf . slElement <$> layouts + fiShowOnFirstSlide = + fromMaybe True + (getBooleanAttribute "showSpecialPlsOnTitleSld" presentation) + pure FooterInfo{..} + where + getShape t hf layout = + if fromMaybe True (getBooleanAttribute t hf) + then do + let ns = elemToNameSpaces layout + cSld <- findChild (elemName ns "p" "cSld") layout + spTree <- findChild (elemName ns "p" "spTree") cSld + let containsPlaceholder sp = fromMaybe False $ do + nvSpPr <- findChild (elemName ns "p" "nvSpPr") sp + nvPr <- findChild (elemName ns "p" "nvPr") nvSpPr + ph <- findChild (elemName ns "p" "ph") nvPr + placeholderType <- findAttr (QName "type" Nothing Nothing) ph + pure (placeholderType == t) + listToMaybe (filterChildren containsPlaceholder spTree) + else Nothing + + getBooleanAttribute t e = + (`elem` ["1", "true"]) <$> + (findAttr (QName t Nothing Nothing) e) + +footerElements :: + PandocMonad m => + (forall a. SlideLayoutsOf a -> a) -> + P m [Content] +footerElements layout = do + footerInfo <- gets stFooterInfo + pure + $ Elem <$> + (toList (footerInfo >>= layout . fiDate) + <> toList (footerInfo >>= layout . fiFooter) + <> toList (footerInfo >>= layout . fiSlideNumber)) + makeSlideIdMap :: Presentation -> M.Map SlideId Int makeSlideIdMap (Presentation _ slides) = M.fromList $ map slideId slides `zip` [1..] @@ -1372,13 +1431,14 @@ contentToElement layout hdrShape shapes (shapeId, element) <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] contentHeaderId = if null hdrShape then Nothing else shapeId - content <- local + content' <- local (\env -> env {envPlaceholder = Placeholder ObjType 0}) (shapesToElements layout shapes) - let contentContentIds = mapMaybe fst content - contentElements = snd <$> content + let contentContentIds = mapMaybe fst content' + contentElements = snd <$> content' + footer <- footerElements content return ( Just ContentShapeIds{..} - , buildSpTree ns spTree (hdrShapeElements <> contentElements) + , buildSpTree ns spTree (hdrShapeElements <> contentElements <> footer) ) contentToElement _ _ _ = return (Nothing, mknode "p:sp" [] ()) @@ -1412,10 +1472,11 @@ twoColumnToElement layout hdrShape shapesL shapesR contentElementsR = snd <$> contentR -- let contentElementsL' = map (setIdx ns "1") contentElementsL -- contentElementsR' = map (setIdx ns "2") contentElementsR + footer <- footerElements twoColumn return $ (Just TwoColumnShapeIds{..}, ) $ buildSpTree ns spTree - $ hdrShapeElements <> contentElementsL <> contentElementsR + $ hdrShapeElements <> contentElementsL <> contentElementsR <> footer twoColumnToElement _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) data ComparisonShapeIds = ComparisonShapeIds @@ -1456,6 +1517,7 @@ comparisonToElement layout hdrShape (shapesL1, shapesL2) (shapesR1, shapesR2) (shapesToElements layout shapesR2) let comparisonRightContentIds = mapMaybe fst contentR2 contentElementsR2 = snd <$> contentR2 + footer <- footerElements comparison return $ (Just ComparisonShapeIds{..}, ) $ buildSpTree ns spTree @@ -1464,7 +1526,7 @@ comparisonToElement layout hdrShape (shapesL1, shapesL2) (shapesR1, shapesR2) , contentElementsL2 , contentElementsR1 , contentElementsR2 - ] + ] <> footer comparisonToElement _ _ _ _= return (Nothing, mknode "p:sp" [] ()) data ContentWithCaptionShapeIds = ContentWithCaptionShapeIds @@ -1495,13 +1557,14 @@ contentWithCaptionToElement layout hdrShape textShapes contentShapes (shapesToElements layout contentShapes) let contentWithCaptionContentIds = mapMaybe fst content contentElements = snd <$> content + footer <- footerElements contentWithCaption return $ (Just ContentWithCaptionShapeIds{..}, ) $ buildSpTree ns spTree $ mconcat [ hdrShapeElements , textElements , contentElements - ] + ] <> footer contentWithCaptionToElement _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) blankToElement :: @@ -1511,8 +1574,8 @@ blankToElement :: blankToElement layout | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout - , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - return $ buildSpTree ns spTree [] + , Just spTree <- findChild (elemName ns "p" "spTree") cSld = + buildSpTree ns spTree <$> footerElements blank blankToElement _ = return $ mknode "p:sp" [] () newtype TitleShapeIds = TitleShapeIds @@ -1531,7 +1594,10 @@ titleToElement layout titleElems (shapeId, element) <- nonBodyTextToElement layout [PHType "title", PHType "ctrTitle"] titleElems let titleShapeElements = [Elem element | not (null titleElems)] titleHeaderId = if null titleElems then Nothing else shapeId - return $ (Just TitleShapeIds{..}, ) $ buildSpTree ns spTree titleShapeElements + footer <- footerElements title + return + $ (Just TitleShapeIds{..}, ) + $ buildSpTree ns spTree (titleShapeElements <> footer) titleToElement _ _ = return (Nothing, mknode "p:sp" [] ()) data MetadataShapeIds = MetadataShapeIds @@ -1561,13 +1627,20 @@ metadataToElement layout titleElems subtitleElems authorsElems dateElems metadataTitleId = if null titleElems then Nothing else titleId subtitleShapeElements = [subtitleElement | not (null subtitleAndAuthorElems)] metadataSubtitleId = if null subtitleAndAuthorElems then Nothing else subtitleId - dateShapeElements = [dateElement | not (null dateElems)] + footerInfo <- gets stFooterInfo + footer <- (if maybe False fiShowOnFirstSlide footerInfo + then id + else const []) <$> footerElements metadata + let dateShapeElements = [dateElement + | not (null dateElems + || isJust (footerInfo >>= metadata . fiDate)) + ] metadataDateId = if null dateElems then Nothing else dateId return $ (Just MetadataShapeIds{..}, ) $ buildSpTree ns spTree - $ map Elem - $ titleShapeElements <> subtitleShapeElements <> dateShapeElements + $ map Elem (titleShapeElements <> subtitleShapeElements <> dateShapeElements) + <> footer metadataToElement _ _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) slideToElement :: PandocMonad m => Slide -> P m Element diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 6e676dc37..b2df80e5f 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -61,187 +61,216 @@ groupPptxTests pairs = tests :: [TestTree] -tests = groupPptxTests [ pptxTests "Inline formatting" - def - "pptx/inline-formatting/input.native" - "pptx/inline-formatting/output.pptx" - , pptxTests "Slide breaks (default slide-level)" - def - "pptx/slide-breaks/input.native" - "pptx/slide-breaks/output.pptx" - , pptxTests "slide breaks (slide-level set to 1)" - def{ writerSlideLevel = Just 1 } - "pptx/slide-breaks/input.native" - "pptx/slide-breaks-slide-level-1/output.pptx" - , pptxTests "lists" - def - "pptx/lists/input.native" - "pptx/lists/output.pptx" - , pptxTests "start ordered list at specified num" - def - "pptx/start-numbering-at/input.native" - "pptx/start-numbering-at/output.pptx" - , pptxTests "tables" - def - "pptx/tables/input.native" - "pptx/tables/output.pptx" - , pptxTests "table of contents" - def{ writerTableOfContents = True } - "pptx/slide-breaks/input.native" - "pptx/slide-breaks-toc/output.pptx" - , pptxTests "end notes" - def - "pptx/endnotes/input.native" - "pptx/endnotes/output.pptx" - , pptxTests "end notes, with table of contents" - def { writerTableOfContents = True } - "pptx/endnotes/input.native" - "pptx/endnotes-toc/output.pptx" - , pptxTests "images" - def - "pptx/images/input.native" - "pptx/images/output.pptx" - , pptxTests "two-column layout" - def - "pptx/two-column/all-text/input.native" - "pptx/two-column/all-text/output.pptx" - , pptxTests "two-column (not comparison)" - def - "pptx/two-column/text-and-image/input.native" - "pptx/two-column/text-and-image/output.pptx" - , pptxTests "speaker notes" - def - "pptx/speaker-notes/input.native" - "pptx/speaker-notes/output.pptx" - , pptxTests "speaker notes after a separating block" - def - "pptx/speaker-notes-afterseps/input.native" - "pptx/speaker-notes-afterseps/output.pptx" - , pptxTests "speaker notes after a separating header" - def - "pptx/speaker-notes-afterheader/input.native" - "pptx/speaker-notes-afterheader/output.pptx" - , pptxTests "speaker notes after metadata" - def - "pptx/speaker-notes-after-metadata/input.native" - "pptx/speaker-notes-after-metadata/output.pptx" - , pptxTests "remove empty slides" - def - "pptx/remove-empty-slides/input.native" - "pptx/remove-empty-slides/output.pptx" - , pptxTests "raw ooxml" - def - "pptx/raw-ooxml/input.native" - "pptx/raw-ooxml/output.pptx" - , pptxTests "metadata, custom properties" - def - "pptx/document-properties/input.native" - "pptx/document-properties/output.pptx" - , pptxTests "metadata, short description" - def - "pptx/document-properties-short-desc/input.native" - "pptx/document-properties-short-desc/output.pptx" - , pptxTests "inline code and code blocks" - def - "pptx/code/input.native" - "pptx/code/output.pptx" - , pptxTests "inline code and code blocks, custom formatting" - def { writerVariables = Context $ M.fromList - [(pack "monofont", toVal $ pack "Consolas")] } - "pptx/code/input.native" - "pptx/code-custom/output.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/input.native" - "pptx/slide-level-0/h1-with-image/output.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/input.native" - "pptx/slide-level-0/h2-with-image/output.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/input.native" - "pptx/slide-level-0/h1-with-table/output.pptx" - , pptxTests ("Using slide level 0, if the first thing on " - <> "a slide is a heading it's used as the " - <> "slide title (content with caption layout)") - def { writerSlideLevel = Just 0 } - "pptx/slide-level-0/h1-h2-with-table/input.native" - "pptx/slide-level-0/h1-h2-with-table/output.pptx" - , pptxTests ("comparison layout used when two columns " - <> "contain text plus non-text") - def - "pptx/comparison/both-columns/input.native" - "pptx/comparison/both-columns/output.pptx" - , pptxTests ("comparison layout used even when only one " - <> "column contains text plus non-text") - def - "pptx/comparison/one-column/input.native" - "pptx/comparison/one-column/output.pptx" - , pptxTests ("extra text in one column in comparison " - <> "layout gets overlaid") - def - "pptx/comparison/extra-text/input.native" - "pptx/comparison/extra-text/output.pptx" - , pptxTests ("extra image in one column in comparison " - <> "layout gets overlaid") - def - "pptx/comparison/extra-image/input.native" - "pptx/comparison/extra-image/output.pptx" - , pptxTests "comparison not used if the non-text comes first" - def - "pptx/comparison/non-text-first/input.native" - "pptx/comparison/non-text-first/output.pptx" - , pptxTests ("Heading, text and an image on the same " - <> "slide uses the Content with Caption " - <> "layout") - def - "pptx/content-with-caption/heading-text-image/input.native" - "pptx/content-with-caption/heading-text-image/output.pptx" - , pptxTests ("Text and an image on the same " - <> "slide uses the Content with Caption " - <> "layout") - def - "pptx/content-with-caption/text-image/input.native" - "pptx/content-with-caption/text-image/output.pptx" - , pptxTests ("If the image comes first, Content with " - <> "Caption is not used") - def - "pptx/content-with-caption/image-text/input.native" - "pptx/content-with-caption/image-text/output.pptx" - , pptxTests ("If a slide contains only speaker notes, the " - <> "Blank layout is used") - def - "pptx/blanks/just-speaker-notes/input.native" - "pptx/blanks/just-speaker-notes/output.pptx" - , pptxTests ("If a slide contains only an empty heading " - <> "with a body of only non-breaking spaces" - <> ", the Blank layout is used") - def - "pptx/blanks/nbsp-in-body/input.native" - "pptx/blanks/nbsp-in-body/output.pptx" - , pptxTests ("If a slide contains only a heading " - <> "containing only non-breaking spaces, " - <> "the Blank layout is used") - def - "pptx/blanks/nbsp-in-heading/input.native" - "pptx/blanks/nbsp-in-heading/output.pptx" - , pptxTests ("Incremental lists are supported") - def { writerIncremental = True } - "pptx/incremental-lists/with-flag/input.native" - "pptx/incremental-lists/with-flag/output.pptx" - , pptxTests ("One-off incremental lists are supported") - def - "pptx/incremental-lists/without-flag/input.native" - "pptx/incremental-lists/without-flag/output.pptx" - , pptxTests "Background images" - def - "pptx/background-image/input.native" - "pptx/background-image/output.pptx" - ] +tests = let + regularTests = + groupPptxTests [ pptxTests "Inline formatting" + def + "pptx/inline-formatting/input.native" + "pptx/inline-formatting/output.pptx" + , pptxTests "Slide breaks (default slide-level)" + def + "pptx/slide-breaks/input.native" + "pptx/slide-breaks/output.pptx" + , pptxTests "slide breaks (slide-level set to 1)" + def{ writerSlideLevel = Just 1 } + "pptx/slide-breaks/input.native" + "pptx/slide-breaks-slide-level-1/output.pptx" + , pptxTests "lists" + def + "pptx/lists/input.native" + "pptx/lists/output.pptx" + , pptxTests "start ordered list at specified num" + def + "pptx/start-numbering-at/input.native" + "pptx/start-numbering-at/output.pptx" + , pptxTests "tables" + def + "pptx/tables/input.native" + "pptx/tables/output.pptx" + , pptxTests "table of contents" + def{ writerTableOfContents = True } + "pptx/slide-breaks/input.native" + "pptx/slide-breaks-toc/output.pptx" + , pptxTests "end notes" + def + "pptx/endnotes/input.native" + "pptx/endnotes/output.pptx" + , pptxTests "end notes, with table of contents" + def { writerTableOfContents = True } + "pptx/endnotes/input.native" + "pptx/endnotes-toc/output.pptx" + , pptxTests "images" + def + "pptx/images/input.native" + "pptx/images/output.pptx" + , pptxTests "two-column layout" + def + "pptx/two-column/all-text/input.native" + "pptx/two-column/all-text/output.pptx" + , pptxTests "two-column (not comparison)" + def + "pptx/two-column/text-and-image/input.native" + "pptx/two-column/text-and-image/output.pptx" + , pptxTests "speaker notes" + def + "pptx/speaker-notes/input.native" + "pptx/speaker-notes/output.pptx" + , pptxTests "speaker notes after a separating block" + def + "pptx/speaker-notes-afterseps/input.native" + "pptx/speaker-notes-afterseps/output.pptx" + , pptxTests "speaker notes after a separating header" + def + "pptx/speaker-notes-afterheader/input.native" + "pptx/speaker-notes-afterheader/output.pptx" + , pptxTests "speaker notes after metadata" + def + "pptx/speaker-notes-after-metadata/input.native" + "pptx/speaker-notes-after-metadata/output.pptx" + , pptxTests "remove empty slides" + def + "pptx/remove-empty-slides/input.native" + "pptx/remove-empty-slides/output.pptx" + , pptxTests "raw ooxml" + def + "pptx/raw-ooxml/input.native" + "pptx/raw-ooxml/output.pptx" + , pptxTests "metadata, custom properties" + def + "pptx/document-properties/input.native" + "pptx/document-properties/output.pptx" + , pptxTests "metadata, short description" + def + "pptx/document-properties-short-desc/input.native" + "pptx/document-properties-short-desc/output.pptx" + , pptxTests "inline code and code blocks" + def + "pptx/code/input.native" + "pptx/code/output.pptx" + , pptxTests "inline code and code blocks, custom formatting" + def { writerVariables = Context $ M.fromList + [(pack "monofont", toVal $ pack "Consolas")] } + "pptx/code/input.native" + "pptx/code-custom/output.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/input.native" + "pptx/slide-level-0/h1-with-image/output.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/input.native" + "pptx/slide-level-0/h2-with-image/output.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/input.native" + "pptx/slide-level-0/h1-with-table/output.pptx" + , pptxTests ("Using slide level 0, if the first thing on " + <> "a slide is a heading it's used as the " + <> "slide title (content with caption layout)") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0/h1-h2-with-table/input.native" + "pptx/slide-level-0/h1-h2-with-table/output.pptx" + , pptxTests ("comparison layout used when two columns " + <> "contain text plus non-text") + def + "pptx/comparison/both-columns/input.native" + "pptx/comparison/both-columns/output.pptx" + , pptxTests ("comparison layout used even when only one " + <> "column contains text plus non-text") + def + "pptx/comparison/one-column/input.native" + "pptx/comparison/one-column/output.pptx" + , pptxTests ("extra text in one column in comparison " + <> "layout gets overlaid") + def + "pptx/comparison/extra-text/input.native" + "pptx/comparison/extra-text/output.pptx" + , pptxTests ("extra image in one column in comparison " + <> "layout gets overlaid") + def + "pptx/comparison/extra-image/input.native" + "pptx/comparison/extra-image/output.pptx" + , pptxTests "comparison not used if the non-text comes first" + def + "pptx/comparison/non-text-first/input.native" + "pptx/comparison/non-text-first/output.pptx" + , pptxTests ("Heading, text and an image on the same " + <> "slide uses the Content with Caption " + <> "layout") + def + "pptx/content-with-caption/heading-text-image/input.native" + "pptx/content-with-caption/heading-text-image/output.pptx" + , pptxTests ("Text and an image on the same " + <> "slide uses the Content with Caption " + <> "layout") + def + "pptx/content-with-caption/text-image/input.native" + "pptx/content-with-caption/text-image/output.pptx" + , pptxTests ("If the image comes first, Content with " + <> "Caption is not used") + def + "pptx/content-with-caption/image-text/input.native" + "pptx/content-with-caption/image-text/output.pptx" + , pptxTests ("If a slide contains only speaker notes, the " + <> "Blank layout is used") + def + "pptx/blanks/just-speaker-notes/input.native" + "pptx/blanks/just-speaker-notes/output.pptx" + , pptxTests ("If a slide contains only an empty heading " + <> "with a body of only non-breaking spaces" + <> ", the Blank layout is used") + def + "pptx/blanks/nbsp-in-body/input.native" + "pptx/blanks/nbsp-in-body/output.pptx" + , pptxTests ("If a slide contains only a heading " + <> "containing only non-breaking spaces, " + <> "the Blank layout is used") + def + "pptx/blanks/nbsp-in-heading/input.native" + "pptx/blanks/nbsp-in-heading/output.pptx" + , pptxTests ("Incremental lists are supported") + def { writerIncremental = True } + "pptx/incremental-lists/with-flag/input.native" + "pptx/incremental-lists/with-flag/output.pptx" + , pptxTests ("One-off incremental lists are supported") + def + "pptx/incremental-lists/without-flag/input.native" + "pptx/incremental-lists/without-flag/output.pptx" + , pptxTests "Background images" + def + "pptx/background-image/input.native" + "pptx/background-image/output.pptx" + ] + referenceSpecificTests = + [ ooxmlTest + writePowerpoint + "Basic footer" + def { writerReferenceDoc = Just "pptx/footer/basic/reference.pptx"} + "pptx/footer/input.native" + "pptx/footer/basic/output.pptx" + , ooxmlTest + writePowerpoint + "Footer with fixed date, replaced by meta block date" + def { writerReferenceDoc = Just "pptx/footer/fixed-date/reference.pptx"} + "pptx/footer/input.native" + "pptx/footer/fixed-date/output.pptx" + , ooxmlTest + writePowerpoint + "Footer not shown on title slide" + def { writerReferenceDoc = Just "pptx/footer/no-title-slide/reference.pptx"} + "pptx/footer/input.native" + "pptx/footer/no-title-slide/output.pptx" + , ooxmlTest + writePowerpoint + "Footer with slide number starting from 3" + def { writerReferenceDoc = Just "pptx/footer/higher-slide-number/reference.pptx"} + "pptx/footer/input.native" + "pptx/footer/higher-slide-number/output.pptx" + ] + in regularTests <> referenceSpecificTests diff --git a/test/pptx/footer/basic/output.pptx b/test/pptx/footer/basic/output.pptx new file mode 100644 index 000000000..db8814418 Binary files /dev/null and b/test/pptx/footer/basic/output.pptx differ diff --git a/test/pptx/footer/basic/reference.pptx b/test/pptx/footer/basic/reference.pptx new file mode 100644 index 000000000..61f926fa6 Binary files /dev/null and b/test/pptx/footer/basic/reference.pptx differ diff --git a/test/pptx/footer/fixed-date/output.pptx b/test/pptx/footer/fixed-date/output.pptx new file mode 100644 index 000000000..85854a744 Binary files /dev/null and b/test/pptx/footer/fixed-date/output.pptx differ diff --git a/test/pptx/footer/fixed-date/reference.pptx b/test/pptx/footer/fixed-date/reference.pptx new file mode 100644 index 000000000..78bd3ce0d Binary files /dev/null and b/test/pptx/footer/fixed-date/reference.pptx differ diff --git a/test/pptx/footer/higher-slide-number/output.pptx b/test/pptx/footer/higher-slide-number/output.pptx new file mode 100644 index 000000000..c5bc3d047 Binary files /dev/null and b/test/pptx/footer/higher-slide-number/output.pptx differ diff --git a/test/pptx/footer/higher-slide-number/reference.pptx b/test/pptx/footer/higher-slide-number/reference.pptx new file mode 100644 index 000000000..6ada45399 Binary files /dev/null and b/test/pptx/footer/higher-slide-number/reference.pptx differ diff --git a/test/pptx/footer/input.native b/test/pptx/footer/input.native new file mode 100644 index 000000000..2c0ae5c06 --- /dev/null +++ b/test/pptx/footer/input.native @@ -0,0 +1,66 @@ +Pandoc (Meta {unMeta = fromList [("author",MetaInlines [Str "Me"]),("date",MetaInlines [Str "14/09/1995"]),("title",MetaInlines [Str "Slides"])]}) +[Header 2 ("slide-1",[],[]) [Str "Slide",Space,Str "1"] +,Para [Str "Hello",Space,Str "there"] +,Header 1 ("layouts",[],[]) [Str "Layouts"] +,Header 2 ("slide-3",[],[]) [Str "Slide",Space,Str "3"] +,Para [Str "Does",Space,Str "it",Space,Str "work",Space,Str "on",Space,Str "other",Space,Str "layouts?"] +,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2) + ,(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "2"]]]])] + (TableFoot ("",[],[]) + []) +,Header 2 ("slide-4",[],[]) [Str "Slide",Space,Str "4"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "hello",Space,Str "hello"]] + ,Div ("",["column"],[]) + [Para [Str "goood",Space,Str "bye"]]] +,Header 2 ("slide-5",[],[]) [Str "Slide",Space,Str "5"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "Hello",Space,Str "there"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2) + ,(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "2"]]]])] + (TableFoot ("",[],[]) + [])] + ,Div ("",["column"],[]) + [Para [Str "oh",Space,Str "wait"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2) + ,(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "2"]]]])] + (TableFoot ("",[],[]) + [])]] +,Header 2 ("section",[],[]) [] +,Div ("",["notes"],[]) + [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "blank",Space,Str "slide:",Space,Str "does",Space,Str "it",Space,Str "have",Space,Str "a",Space,Str "footer?"]]] diff --git a/test/pptx/footer/no-title-slide/output.pptx b/test/pptx/footer/no-title-slide/output.pptx new file mode 100644 index 000000000..d1475bf1f Binary files /dev/null and b/test/pptx/footer/no-title-slide/output.pptx differ diff --git a/test/pptx/footer/no-title-slide/reference.pptx b/test/pptx/footer/no-title-slide/reference.pptx new file mode 100644 index 000000000..ecd524a9b Binary files /dev/null and b/test/pptx/footer/no-title-slide/reference.pptx differ -- cgit v1.2.3 From 62f83aa48633af477913bde6f615fe9f8793901a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 4 Oct 2021 11:45:01 -0700 Subject: Powerpoint writer: consolidate text run nodes. This should reduce the size of the generated files. --- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 10 +++++++++- test/pptx/background-image/deleted-layouts.pptx | Bin 56282 -> 56266 bytes test/pptx/background-image/moved-layouts.pptx | Bin 66987 -> 66972 bytes test/pptx/background-image/output.pptx | Bin 53408 -> 53393 bytes test/pptx/background-image/templated.pptx | Bin 66487 -> 66472 bytes .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35178 -> 35171 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45870 -> 45863 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32297 -> 32291 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 45365 -> 45358 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 32092 -> 32090 bytes test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 42780 -> 42778 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 29211 -> 29210 bytes test/pptx/blanks/nbsp-in-body/templated.pptx | Bin 42280 -> 42278 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 32092 -> 32090 bytes test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 42780 -> 42778 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 29211 -> 29210 bytes test/pptx/blanks/nbsp-in-heading/templated.pptx | Bin 42280 -> 42278 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 32717 -> 32711 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 43405 -> 43398 bytes test/pptx/code-custom/output.pptx | Bin 29836 -> 29831 bytes test/pptx/code-custom/templated.pptx | Bin 42905 -> 42897 bytes test/pptx/code/deleted-layouts.pptx | Bin 32716 -> 32709 bytes test/pptx/code/moved-layouts.pptx | Bin 43405 -> 43398 bytes test/pptx/code/output.pptx | Bin 29835 -> 29829 bytes test/pptx/code/templated.pptx | Bin 42905 -> 42897 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 47453 -> 47449 bytes .../pptx/comparison/both-columns/moved-layouts.pptx | Bin 58172 -> 58169 bytes test/pptx/comparison/both-columns/output.pptx | Bin 44581 -> 44578 bytes test/pptx/comparison/both-columns/templated.pptx | Bin 57674 -> 57671 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 47482 -> 47481 bytes test/pptx/comparison/extra-image/moved-layouts.pptx | Bin 58200 -> 58196 bytes test/pptx/comparison/extra-image/output.pptx | Bin 44610 -> 44610 bytes test/pptx/comparison/extra-image/templated.pptx | Bin 57702 -> 57699 bytes .../pptx/comparison/extra-text/deleted-layouts.pptx | Bin 47453 -> 47449 bytes test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 58172 -> 58168 bytes test/pptx/comparison/extra-text/output.pptx | Bin 44581 -> 44578 bytes test/pptx/comparison/extra-text/templated.pptx | Bin 57674 -> 57671 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 47366 -> 47370 bytes .../comparison/non-text-first/moved-layouts.pptx | Bin 58065 -> 58063 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 44494 -> 44499 bytes test/pptx/comparison/non-text-first/templated.pptx | Bin 57567 -> 57566 bytes .../pptx/comparison/one-column/deleted-layouts.pptx | Bin 30785 -> 30785 bytes test/pptx/comparison/one-column/moved-layouts.pptx | Bin 41506 -> 41506 bytes test/pptx/comparison/one-column/output.pptx | Bin 27906 -> 27907 bytes test/pptx/comparison/one-column/templated.pptx | Bin 41006 -> 41006 bytes .../heading-text-image/deleted-layouts.pptx | Bin 47198 -> 47199 bytes .../heading-text-image/moved-layouts.pptx | Bin 57896 -> 57896 bytes .../heading-text-image/output.pptx | Bin 44326 -> 44328 bytes .../heading-text-image/templated.pptx | Bin 57398 -> 57399 bytes .../image-text/deleted-layouts.pptx | Bin 47896 -> 47896 bytes .../image-text/moved-layouts.pptx | Bin 58584 -> 58584 bytes .../content-with-caption/image-text/output.pptx | Bin 45022 -> 45023 bytes .../content-with-caption/image-text/templated.pptx | Bin 58084 -> 58084 bytes .../text-image/deleted-layouts.pptx | Bin 47137 -> 47136 bytes .../text-image/moved-layouts.pptx | Bin 57836 -> 57836 bytes .../content-with-caption/text-image/output.pptx | Bin 44265 -> 44265 bytes .../content-with-caption/text-image/templated.pptx | Bin 57338 -> 57338 bytes .../deleted-layouts.pptx | Bin 31490 -> 31489 bytes .../moved-layouts.pptx | Bin 42178 -> 42177 bytes .../pptx/document-properties-short-desc/output.pptx | Bin 28619 -> 28620 bytes .../document-properties-short-desc/templated.pptx | Bin 41678 -> 41677 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 31894 -> 31896 bytes test/pptx/document-properties/moved-layouts.pptx | Bin 42582 -> 42583 bytes test/pptx/document-properties/output.pptx | Bin 29025 -> 29026 bytes test/pptx/document-properties/templated.pptx | Bin 42082 -> 42083 bytes test/pptx/footer/basic/output.pptx | Bin 52775 -> 52757 bytes test/pptx/footer/fixed-date/output.pptx | Bin 51397 -> 51376 bytes test/pptx/footer/higher-slide-number/output.pptx | Bin 52790 -> 52771 bytes test/pptx/footer/no-title-slide/output.pptx | Bin 52362 -> 52343 bytes test/pptx/images/deleted-layouts.pptx | Bin 49121 -> 49120 bytes test/pptx/images/moved-layouts.pptx | Bin 59809 -> 59808 bytes test/pptx/images/output.pptx | Bin 46244 -> 46243 bytes test/pptx/images/templated.pptx | Bin 59308 -> 59308 bytes .../with-flag/deleted-layouts.pptx | Bin 80172 -> 80140 bytes .../incremental-lists/with-flag/moved-layouts.pptx | Bin 90917 -> 90883 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77298 -> 77267 bytes .../pptx/incremental-lists/with-flag/templated.pptx | Bin 90414 -> 90380 bytes .../without-flag/deleted-layouts.pptx | Bin 78405 -> 78375 bytes .../without-flag/moved-layouts.pptx | Bin 89148 -> 89115 bytes .../pptx/incremental-lists/without-flag/output.pptx | Bin 75533 -> 75504 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88645 -> 88612 bytes test/pptx/lists/deleted-layouts.pptx | Bin 31545 -> 31545 bytes test/pptx/lists/moved-layouts.pptx | Bin 42233 -> 42233 bytes test/pptx/lists/output.pptx | Bin 28667 -> 28668 bytes test/pptx/lists/templated.pptx | Bin 41733 -> 41734 bytes .../slide-breaks-slide-level-1/deleted-layouts.pptx | Bin 32238 -> 32238 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 42926 -> 42926 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 29357 -> 29358 bytes test/pptx/slide-breaks-slide-level-1/templated.pptx | Bin 42426 -> 42427 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 34012 -> 34013 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 44701 -> 44702 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31133 -> 31135 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 44201 -> 44203 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 33062 -> 33063 bytes test/pptx/slide-breaks/moved-layouts.pptx | Bin 43751 -> 43752 bytes test/pptx/slide-breaks/output.pptx | Bin 30183 -> 30185 bytes test/pptx/slide-breaks/templated.pptx | Bin 43250 -> 43252 bytes .../h1-with-image/deleted-layouts.pptx | Bin 47118 -> 47119 bytes .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 57804 -> 57805 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 44245 -> 44247 bytes .../pptx/slide-level-0/h1-with-image/templated.pptx | Bin 57306 -> 57306 bytes .../h2-with-image/deleted-layouts.pptx | Bin 47118 -> 47119 bytes .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 57804 -> 57805 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 44245 -> 44247 bytes .../pptx/slide-level-0/h2-with-image/templated.pptx | Bin 57306 -> 57306 bytes .../deleted-layouts.pptx | Bin 34504 -> 34500 bytes .../speaker-notes-after-metadata/moved-layouts.pptx | Bin 45193 -> 45189 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31634 -> 31632 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 44690 -> 44685 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33532 -> 33524 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44220 -> 44212 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30653 -> 30646 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 43719 -> 43710 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54429 -> 54414 bytes .../pptx/speaker-notes-afterseps/moved-layouts.pptx | Bin 65119 -> 65104 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51548 -> 51534 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64614 -> 64598 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38236 -> 38227 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 48929 -> 48920 bytes test/pptx/speaker-notes/output.pptx | Bin 35358 -> 35350 bytes test/pptx/speaker-notes/templated.pptx | Bin 48423 -> 48413 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 31521 -> 31517 bytes test/pptx/start-numbering-at/moved-layouts.pptx | Bin 42209 -> 42205 bytes test/pptx/start-numbering-at/output.pptx | Bin 28643 -> 28640 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41709 -> 41706 bytes test/pptx/tables/deleted-layouts.pptx | Bin 32065 -> 32059 bytes test/pptx/tables/moved-layouts.pptx | Bin 42753 -> 42747 bytes test/pptx/tables/output.pptx | Bin 29184 -> 29179 bytes test/pptx/tables/templated.pptx | Bin 42253 -> 42248 bytes test/pptx/two-column/all-text/deleted-layouts.pptx | Bin 30568 -> 30569 bytes test/pptx/two-column/all-text/moved-layouts.pptx | Bin 41256 -> 41257 bytes test/pptx/two-column/all-text/output.pptx | Bin 27689 -> 27691 bytes test/pptx/two-column/all-text/templated.pptx | Bin 40756 -> 40758 bytes .../two-column/text-and-image/deleted-layouts.pptx | Bin 48392 -> 48389 bytes .../two-column/text-and-image/moved-layouts.pptx | Bin 59086 -> 59084 bytes test/pptx/two-column/text-and-image/output.pptx | Bin 45520 -> 45518 bytes test/pptx/two-column/text-and-image/templated.pptx | Bin 58586 -> 58585 bytes 137 files changed, 9 insertions(+), 1 deletion(-) (limited to 'test/pptx') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index e3d31d099..1680bc7ac 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -348,7 +348,15 @@ instance Default PicProps where -------------------------------------------------- inlinesToParElems :: [Inline] -> Pres [ParaElem] -inlinesToParElems ils = concatMapM inlineToParElems ils +inlinesToParElems = concatMapM inlineToParElems . consolidateStrs + where + -- we combine Str + Space combinations, because this makes + -- the resulting ooxml much more compact, with fewer independent + -- text run elements + consolidateStrs [] = [] + consolidateStrs (Str t : Space : ils) = consolidateStrs (Str (t <> " ") : ils) + consolidateStrs (Space : Str t : ils) = consolidateStrs (Str (" " <> t) : ils) + consolidateStrs (il : ils) = il : consolidateStrs ils inlineToParElems :: Inline -> Pres [ParaElem] inlineToParElems (Str s) = do diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx index 05d4104b7..41f13db87 100644 Binary files a/test/pptx/background-image/deleted-layouts.pptx and b/test/pptx/background-image/deleted-layouts.pptx differ diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx index 73b69e1d6..ca7a8a9d5 100644 Binary files a/test/pptx/background-image/moved-layouts.pptx and b/test/pptx/background-image/moved-layouts.pptx differ diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx index 9738eefb8..f3c2c7606 100644 Binary files a/test/pptx/background-image/output.pptx and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/background-image/templated.pptx b/test/pptx/background-image/templated.pptx index 52d304957..442fe3bdd 100644 Binary files a/test/pptx/background-image/templated.pptx and b/test/pptx/background-image/templated.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx index 5038f2aaf..3dcc1d444 100644 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx index 90353a560..c63d94774 100644 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 799c0f14a..9377013a0 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx index 5e3afb5f8..ed65b8f32 100644 Binary files a/test/pptx/blanks/just-speaker-notes/templated.pptx and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx index 7716e1cbf..650da51db 100644 Binary files a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx index 3dc6c817e..45cf168a9 100644 Binary files a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx index 1df3f9574..57c6e3b6e 100644 Binary files a/test/pptx/blanks/nbsp-in-body/output.pptx and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/templated.pptx b/test/pptx/blanks/nbsp-in-body/templated.pptx index 1cf58a1bb..8cc5d053a 100644 Binary files a/test/pptx/blanks/nbsp-in-body/templated.pptx and b/test/pptx/blanks/nbsp-in-body/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx index 7716e1cbf..8b1d0a37b 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx index 3dc6c817e..45cf168a9 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx index e528091d7..57c6e3b6e 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/output.pptx and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/templated.pptx b/test/pptx/blanks/nbsp-in-heading/templated.pptx index 1f2d91399..8cc5d053a 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/templated.pptx and b/test/pptx/blanks/nbsp-in-heading/templated.pptx differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx index b49cd4896..04e6dadd1 100644 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx index c6806f37f..caacdab47 100644 Binary files a/test/pptx/code-custom/moved-layouts.pptx and b/test/pptx/code-custom/moved-layouts.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index a72bebbe2..f5aa05b41 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 2bdb526fa..160f85bdf 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx index df7814599..bbfabede2 100644 Binary files a/test/pptx/code/deleted-layouts.pptx and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx index 71e8560bd..7950abbad 100644 Binary files a/test/pptx/code/moved-layouts.pptx and b/test/pptx/code/moved-layouts.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index 4b70df2c7..ce08a9c64 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index 1285a9273..2a37db25a 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx index 27f9d9ac7..03ee6c408 100644 Binary files a/test/pptx/comparison/both-columns/deleted-layouts.pptx and b/test/pptx/comparison/both-columns/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx index a658045ef..bb5f046fd 100644 Binary files a/test/pptx/comparison/both-columns/moved-layouts.pptx and b/test/pptx/comparison/both-columns/moved-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx index 560c7d41a..345833b8b 100644 Binary files a/test/pptx/comparison/both-columns/output.pptx and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx index 2fb38880d..3dcc6274f 100644 Binary files a/test/pptx/comparison/both-columns/templated.pptx and b/test/pptx/comparison/both-columns/templated.pptx differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx index 267c7cb69..0ad383194 100644 Binary files a/test/pptx/comparison/extra-image/deleted-layouts.pptx and b/test/pptx/comparison/extra-image/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx index b7023026c..30bf2450b 100644 Binary files a/test/pptx/comparison/extra-image/moved-layouts.pptx and b/test/pptx/comparison/extra-image/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx index 06d632ee7..464a07d88 100644 Binary files a/test/pptx/comparison/extra-image/output.pptx and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx index af84388c4..771b16cda 100644 Binary files a/test/pptx/comparison/extra-image/templated.pptx and b/test/pptx/comparison/extra-image/templated.pptx differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx index 27f9d9ac7..03ee6c408 100644 Binary files a/test/pptx/comparison/extra-text/deleted-layouts.pptx and b/test/pptx/comparison/extra-text/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx index a658045ef..2541e97d3 100644 Binary files a/test/pptx/comparison/extra-text/moved-layouts.pptx and b/test/pptx/comparison/extra-text/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx index 560c7d41a..345833b8b 100644 Binary files a/test/pptx/comparison/extra-text/output.pptx and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx index 2fb38880d..8d78e715a 100644 Binary files a/test/pptx/comparison/extra-text/templated.pptx and b/test/pptx/comparison/extra-text/templated.pptx differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx index be30d8368..d2fab6c94 100644 Binary files a/test/pptx/comparison/non-text-first/deleted-layouts.pptx and b/test/pptx/comparison/non-text-first/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx index c4879b7d5..16d59be78 100644 Binary files a/test/pptx/comparison/non-text-first/moved-layouts.pptx and b/test/pptx/comparison/non-text-first/moved-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx index 099cf6729..5f5d12d2f 100644 Binary files a/test/pptx/comparison/non-text-first/output.pptx and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx index 31ac01f18..520021af3 100644 Binary files a/test/pptx/comparison/non-text-first/templated.pptx and b/test/pptx/comparison/non-text-first/templated.pptx differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx index 27620f05f..5a31c333a 100644 Binary files a/test/pptx/comparison/one-column/deleted-layouts.pptx and b/test/pptx/comparison/one-column/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx index fc64d3af5..cce84cc9f 100644 Binary files a/test/pptx/comparison/one-column/moved-layouts.pptx and b/test/pptx/comparison/one-column/moved-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx index 854a968af..cc690844f 100644 Binary files a/test/pptx/comparison/one-column/output.pptx and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx index 9e671af1d..309a25d6e 100644 Binary files a/test/pptx/comparison/one-column/templated.pptx and b/test/pptx/comparison/one-column/templated.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx index 3cd09a916..1a94474ea 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx index 8e76bc94c..32d76ca3d 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx index 5c680e878..aea085efc 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/output.pptx and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx index bdde384a4..07becc7f8 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/templated.pptx and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx index 376880b41..4e834f056 100644 Binary files a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx index 9e33d3163..44a689c30 100644 Binary files a/test/pptx/content-with-caption/image-text/moved-layouts.pptx and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx index c88030b94..e1595c428 100644 Binary files a/test/pptx/content-with-caption/image-text/output.pptx and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx index a22e9ae3e..58264a92d 100644 Binary files a/test/pptx/content-with-caption/image-text/templated.pptx and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx index 2dcb8b78e..e548a7798 100644 Binary files a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx index 7d187a168..ca0e74a18 100644 Binary files a/test/pptx/content-with-caption/text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx index 751121cf2..3fdf9ea07 100644 Binary files a/test/pptx/content-with-caption/text-image/output.pptx and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx index 4f0aaaa7a..bd96bd723 100644 Binary files a/test/pptx/content-with-caption/text-image/templated.pptx and b/test/pptx/content-with-caption/text-image/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx index 79517481a..f8903bbd4 100644 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx index 51608c2e9..59674d5dd 100644 Binary files a/test/pptx/document-properties-short-desc/moved-layouts.pptx and b/test/pptx/document-properties-short-desc/moved-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx index 02c241b89..2c1ef0faa 100644 Binary files a/test/pptx/document-properties-short-desc/output.pptx and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/templated.pptx b/test/pptx/document-properties-short-desc/templated.pptx index 82ccc072c..3e004942c 100644 Binary files a/test/pptx/document-properties-short-desc/templated.pptx and b/test/pptx/document-properties-short-desc/templated.pptx differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx index 12f6570cf..229cfc5a7 100644 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx index 9a9d4ac3e..18d35eb26 100644 Binary files a/test/pptx/document-properties/moved-layouts.pptx and b/test/pptx/document-properties/moved-layouts.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx index cfd3261bc..51f7a5116 100644 Binary files a/test/pptx/document-properties/output.pptx and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/document-properties/templated.pptx b/test/pptx/document-properties/templated.pptx index 3d52d22df..6e37cd4a1 100644 Binary files a/test/pptx/document-properties/templated.pptx and b/test/pptx/document-properties/templated.pptx differ diff --git a/test/pptx/footer/basic/output.pptx b/test/pptx/footer/basic/output.pptx index db8814418..8a2595016 100644 Binary files a/test/pptx/footer/basic/output.pptx and b/test/pptx/footer/basic/output.pptx differ diff --git a/test/pptx/footer/fixed-date/output.pptx b/test/pptx/footer/fixed-date/output.pptx index 85854a744..b6857e8cf 100644 Binary files a/test/pptx/footer/fixed-date/output.pptx and b/test/pptx/footer/fixed-date/output.pptx differ diff --git a/test/pptx/footer/higher-slide-number/output.pptx b/test/pptx/footer/higher-slide-number/output.pptx index c5bc3d047..1e3bfc5aa 100644 Binary files a/test/pptx/footer/higher-slide-number/output.pptx and b/test/pptx/footer/higher-slide-number/output.pptx differ diff --git a/test/pptx/footer/no-title-slide/output.pptx b/test/pptx/footer/no-title-slide/output.pptx index d1475bf1f..a36a80406 100644 Binary files a/test/pptx/footer/no-title-slide/output.pptx and b/test/pptx/footer/no-title-slide/output.pptx differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx index 9f0f41c37..5da21f29c 100644 Binary files a/test/pptx/images/deleted-layouts.pptx and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx index f26ac9e8f..a394237ca 100644 Binary files a/test/pptx/images/moved-layouts.pptx and b/test/pptx/images/moved-layouts.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx index 993209a45..0c4a774b1 100644 Binary files a/test/pptx/images/output.pptx and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/images/templated.pptx b/test/pptx/images/templated.pptx index 06b337538..9bb4567cf 100644 Binary files a/test/pptx/images/templated.pptx and b/test/pptx/images/templated.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx index 5a74826a4..180ac47b7 100644 Binary files a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx index f20dd2906..1b6fc81b2 100644 Binary files a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index d4f76f1e7..2cfffc0e9 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index f5ee2ff5f..7d9292f5c 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx index 16bd85ffd..6d68aafef 100644 Binary files a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx index 054fe918e..5bb33a6b4 100644 Binary files a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 1b326461d..4afae23d9 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index dee6e9b06..62b0ab802 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx index 1670eada1..d8fd26264 100644 Binary files a/test/pptx/lists/deleted-layouts.pptx and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx index f7590c5f9..30319c6b8 100644 Binary files a/test/pptx/lists/moved-layouts.pptx and b/test/pptx/lists/moved-layouts.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index 95510e92e..7a7c9488b 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 7af437bfe..9cece3499 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx index 334fdea9c..5f672b9d8 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx index 3faabfd93..159a8bb0f 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx index 96b9907cc..f1c8c8f46 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/output.pptx and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/templated.pptx b/test/pptx/slide-breaks-slide-level-1/templated.pptx index 9f23f1d9f..7baaf5791 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/templated.pptx and b/test/pptx/slide-breaks-slide-level-1/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx index 0492ee2ec..cd0372c89 100644 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx index f3e56652c..dc94f201b 100644 Binary files a/test/pptx/slide-breaks-toc/moved-layouts.pptx and b/test/pptx/slide-breaks-toc/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index b3063b15e..c9df30e6b 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index bcb2f8276..36ae13623 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx index 827c7dfda..b6cd32a04 100644 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx index 241605754..48c50a709 100644 Binary files a/test/pptx/slide-breaks/moved-layouts.pptx and b/test/pptx/slide-breaks/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx index 55c09a80e..30c3c1a8e 100644 Binary files a/test/pptx/slide-breaks/output.pptx and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-breaks/templated.pptx b/test/pptx/slide-breaks/templated.pptx index f60f7da06..84581a358 100644 Binary files a/test/pptx/slide-breaks/templated.pptx and b/test/pptx/slide-breaks/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx index 7bc7cfeee..8903ff6fa 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx index 602df1c77..65491db8c 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx index f725760dc..bdada1cad 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/output.pptx and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/templated.pptx b/test/pptx/slide-level-0/h1-with-image/templated.pptx index b203ff671..e1c85d948 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/templated.pptx and b/test/pptx/slide-level-0/h1-with-image/templated.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx index 7bc7cfeee..8903ff6fa 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx index 602df1c77..65491db8c 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx index f725760dc..bdada1cad 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/output.pptx and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/templated.pptx b/test/pptx/slide-level-0/h2-with-image/templated.pptx index b203ff671..e1c85d948 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/templated.pptx and b/test/pptx/slide-level-0/h2-with-image/templated.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 9010ba04a..30bd36e5d 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx index ca53605b7..b05079ef2 100644 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index 607115858..41e3148cb 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx index 3be3ed0af..9cdc0ef9f 100644 Binary files a/test/pptx/speaker-notes-after-metadata/templated.pptx and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 2c2a0936b..54de85128 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx index a9c8bfa0a..4e4a854e5 100644 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index ff403aa1c..96b136ef9 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx index 15435c45a..abdc71ebc 100644 Binary files a/test/pptx/speaker-notes-afterheader/templated.pptx and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index f6abb0b27..99e499f4d 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx index 6a770fc75..49f7360c7 100644 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 7e56147f1..3a426d29a 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index 3184ff74e..8e26e7581 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index 5429b88e0..a8014c666 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx index 13e34698d..be5c383c3 100644 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index 74041a40d..0fe2b7783 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx index 80a3e3dea..70e1a2c88 100644 Binary files a/test/pptx/speaker-notes/templated.pptx and b/test/pptx/speaker-notes/templated.pptx differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx index 7bfe9868f..8692da129 100644 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx index 0100365ec..7e1a68a0d 100644 Binary files a/test/pptx/start-numbering-at/moved-layouts.pptx and b/test/pptx/start-numbering-at/moved-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index 3ba9a236a..95a0c8ef4 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index 8a144d601..b4302f6d5 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx index 163d4ca5e..ebad0c49b 100644 Binary files a/test/pptx/tables/deleted-layouts.pptx and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx index 1b0e606da..2ad4646a6 100644 Binary files a/test/pptx/tables/moved-layouts.pptx and b/test/pptx/tables/moved-layouts.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx index 1c89d8032..81f7a21c1 100644 Binary files a/test/pptx/tables/output.pptx and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/tables/templated.pptx b/test/pptx/tables/templated.pptx index 5755bfe9d..538bec0fb 100644 Binary files a/test/pptx/tables/templated.pptx and b/test/pptx/tables/templated.pptx differ diff --git a/test/pptx/two-column/all-text/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx index 1d7bd87d3..58400da56 100644 Binary files a/test/pptx/two-column/all-text/deleted-layouts.pptx and b/test/pptx/two-column/all-text/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx index 71760268c..7e94ede93 100644 Binary files a/test/pptx/two-column/all-text/moved-layouts.pptx and b/test/pptx/two-column/all-text/moved-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/output.pptx b/test/pptx/two-column/all-text/output.pptx index 396dc2a74..f5d871c53 100644 Binary files a/test/pptx/two-column/all-text/output.pptx and b/test/pptx/two-column/all-text/output.pptx differ diff --git a/test/pptx/two-column/all-text/templated.pptx b/test/pptx/two-column/all-text/templated.pptx index 8901695b1..d5f563006 100644 Binary files a/test/pptx/two-column/all-text/templated.pptx and b/test/pptx/two-column/all-text/templated.pptx differ diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx index 297fd6bad..43ced4431 100644 Binary files a/test/pptx/two-column/text-and-image/deleted-layouts.pptx and b/test/pptx/two-column/text-and-image/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx index c9a6e577e..231723f10 100644 Binary files a/test/pptx/two-column/text-and-image/moved-layouts.pptx and b/test/pptx/two-column/text-and-image/moved-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx index bfd532ed9..bb6af0d74 100644 Binary files a/test/pptx/two-column/text-and-image/output.pptx and b/test/pptx/two-column/text-and-image/output.pptx differ diff --git a/test/pptx/two-column/text-and-image/templated.pptx b/test/pptx/two-column/text-and-image/templated.pptx index 23e6b283f..4014b0bf1 100644 Binary files a/test/pptx/two-column/text-and-image/templated.pptx and b/test/pptx/two-column/text-and-image/templated.pptx differ -- cgit v1.2.3 From 82d587493d97536a64110902f647d953b5f28dd4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 4 Oct 2021 11:50:32 -0700 Subject: Revert "Powerpoint writer: consolidate text run nodes." This reverts commit 62f83aa48633af477913bde6f615fe9f8793901a. This was already being done, it seems. I misidentified the problem; it is really with `Str ""` nodes. --- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 10 +--------- test/pptx/background-image/deleted-layouts.pptx | Bin 56266 -> 56282 bytes test/pptx/background-image/moved-layouts.pptx | Bin 66972 -> 66987 bytes test/pptx/background-image/output.pptx | Bin 53393 -> 53408 bytes test/pptx/background-image/templated.pptx | Bin 66472 -> 66487 bytes .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35171 -> 35178 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45863 -> 45870 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32291 -> 32297 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 45358 -> 45365 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 32090 -> 32092 bytes test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 42778 -> 42780 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 29210 -> 29211 bytes test/pptx/blanks/nbsp-in-body/templated.pptx | Bin 42278 -> 42280 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 32090 -> 32092 bytes test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 42778 -> 42780 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 29210 -> 29211 bytes test/pptx/blanks/nbsp-in-heading/templated.pptx | Bin 42278 -> 42280 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 32711 -> 32717 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 43398 -> 43405 bytes test/pptx/code-custom/output.pptx | Bin 29831 -> 29836 bytes test/pptx/code-custom/templated.pptx | Bin 42897 -> 42905 bytes test/pptx/code/deleted-layouts.pptx | Bin 32709 -> 32716 bytes test/pptx/code/moved-layouts.pptx | Bin 43398 -> 43405 bytes test/pptx/code/output.pptx | Bin 29829 -> 29835 bytes test/pptx/code/templated.pptx | Bin 42897 -> 42905 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 47449 -> 47453 bytes .../pptx/comparison/both-columns/moved-layouts.pptx | Bin 58169 -> 58172 bytes test/pptx/comparison/both-columns/output.pptx | Bin 44578 -> 44581 bytes test/pptx/comparison/both-columns/templated.pptx | Bin 57671 -> 57674 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 47481 -> 47482 bytes test/pptx/comparison/extra-image/moved-layouts.pptx | Bin 58196 -> 58200 bytes test/pptx/comparison/extra-image/output.pptx | Bin 44610 -> 44610 bytes test/pptx/comparison/extra-image/templated.pptx | Bin 57699 -> 57702 bytes .../pptx/comparison/extra-text/deleted-layouts.pptx | Bin 47449 -> 47453 bytes test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 58168 -> 58172 bytes test/pptx/comparison/extra-text/output.pptx | Bin 44578 -> 44581 bytes test/pptx/comparison/extra-text/templated.pptx | Bin 57671 -> 57674 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 47370 -> 47366 bytes .../comparison/non-text-first/moved-layouts.pptx | Bin 58063 -> 58065 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 44499 -> 44494 bytes test/pptx/comparison/non-text-first/templated.pptx | Bin 57566 -> 57567 bytes .../pptx/comparison/one-column/deleted-layouts.pptx | Bin 30785 -> 30785 bytes test/pptx/comparison/one-column/moved-layouts.pptx | Bin 41506 -> 41506 bytes test/pptx/comparison/one-column/output.pptx | Bin 27907 -> 27906 bytes test/pptx/comparison/one-column/templated.pptx | Bin 41006 -> 41006 bytes .../heading-text-image/deleted-layouts.pptx | Bin 47199 -> 47198 bytes .../heading-text-image/moved-layouts.pptx | Bin 57896 -> 57896 bytes .../heading-text-image/output.pptx | Bin 44328 -> 44326 bytes .../heading-text-image/templated.pptx | Bin 57399 -> 57398 bytes .../image-text/deleted-layouts.pptx | Bin 47896 -> 47896 bytes .../image-text/moved-layouts.pptx | Bin 58584 -> 58584 bytes .../content-with-caption/image-text/output.pptx | Bin 45023 -> 45022 bytes .../content-with-caption/image-text/templated.pptx | Bin 58084 -> 58084 bytes .../text-image/deleted-layouts.pptx | Bin 47136 -> 47137 bytes .../text-image/moved-layouts.pptx | Bin 57836 -> 57836 bytes .../content-with-caption/text-image/output.pptx | Bin 44265 -> 44265 bytes .../content-with-caption/text-image/templated.pptx | Bin 57338 -> 57338 bytes .../deleted-layouts.pptx | Bin 31489 -> 31490 bytes .../moved-layouts.pptx | Bin 42177 -> 42178 bytes .../pptx/document-properties-short-desc/output.pptx | Bin 28620 -> 28619 bytes .../document-properties-short-desc/templated.pptx | Bin 41677 -> 41678 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 31896 -> 31894 bytes test/pptx/document-properties/moved-layouts.pptx | Bin 42583 -> 42582 bytes test/pptx/document-properties/output.pptx | Bin 29026 -> 29025 bytes test/pptx/document-properties/templated.pptx | Bin 42083 -> 42082 bytes test/pptx/footer/basic/output.pptx | Bin 52757 -> 52775 bytes test/pptx/footer/fixed-date/output.pptx | Bin 51376 -> 51397 bytes test/pptx/footer/higher-slide-number/output.pptx | Bin 52771 -> 52790 bytes test/pptx/footer/no-title-slide/output.pptx | Bin 52343 -> 52362 bytes test/pptx/images/deleted-layouts.pptx | Bin 49120 -> 49121 bytes test/pptx/images/moved-layouts.pptx | Bin 59808 -> 59809 bytes test/pptx/images/output.pptx | Bin 46243 -> 46244 bytes test/pptx/images/templated.pptx | Bin 59308 -> 59308 bytes .../with-flag/deleted-layouts.pptx | Bin 80140 -> 80172 bytes .../incremental-lists/with-flag/moved-layouts.pptx | Bin 90883 -> 90917 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77267 -> 77298 bytes .../pptx/incremental-lists/with-flag/templated.pptx | Bin 90380 -> 90414 bytes .../without-flag/deleted-layouts.pptx | Bin 78375 -> 78405 bytes .../without-flag/moved-layouts.pptx | Bin 89115 -> 89148 bytes .../pptx/incremental-lists/without-flag/output.pptx | Bin 75504 -> 75533 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88612 -> 88645 bytes test/pptx/lists/deleted-layouts.pptx | Bin 31545 -> 31545 bytes test/pptx/lists/moved-layouts.pptx | Bin 42233 -> 42233 bytes test/pptx/lists/output.pptx | Bin 28668 -> 28667 bytes test/pptx/lists/templated.pptx | Bin 41734 -> 41733 bytes .../slide-breaks-slide-level-1/deleted-layouts.pptx | Bin 32238 -> 32238 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 42926 -> 42926 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 29358 -> 29357 bytes test/pptx/slide-breaks-slide-level-1/templated.pptx | Bin 42427 -> 42426 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 34013 -> 34012 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 44702 -> 44701 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31135 -> 31133 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 44203 -> 44201 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 33063 -> 33062 bytes test/pptx/slide-breaks/moved-layouts.pptx | Bin 43752 -> 43751 bytes test/pptx/slide-breaks/output.pptx | Bin 30185 -> 30183 bytes test/pptx/slide-breaks/templated.pptx | Bin 43252 -> 43250 bytes .../h1-with-image/deleted-layouts.pptx | Bin 47119 -> 47118 bytes .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 57805 -> 57804 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 44247 -> 44245 bytes .../pptx/slide-level-0/h1-with-image/templated.pptx | Bin 57306 -> 57306 bytes .../h2-with-image/deleted-layouts.pptx | Bin 47119 -> 47118 bytes .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 57805 -> 57804 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 44247 -> 44245 bytes .../pptx/slide-level-0/h2-with-image/templated.pptx | Bin 57306 -> 57306 bytes .../deleted-layouts.pptx | Bin 34500 -> 34504 bytes .../speaker-notes-after-metadata/moved-layouts.pptx | Bin 45189 -> 45193 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31632 -> 31634 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 44685 -> 44690 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33524 -> 33532 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44212 -> 44220 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30646 -> 30653 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 43710 -> 43719 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54414 -> 54429 bytes .../pptx/speaker-notes-afterseps/moved-layouts.pptx | Bin 65104 -> 65119 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51534 -> 51548 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64598 -> 64614 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38227 -> 38236 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 48920 -> 48929 bytes test/pptx/speaker-notes/output.pptx | Bin 35350 -> 35358 bytes test/pptx/speaker-notes/templated.pptx | Bin 48413 -> 48423 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 31517 -> 31521 bytes test/pptx/start-numbering-at/moved-layouts.pptx | Bin 42205 -> 42209 bytes test/pptx/start-numbering-at/output.pptx | Bin 28640 -> 28643 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41706 -> 41709 bytes test/pptx/tables/deleted-layouts.pptx | Bin 32059 -> 32065 bytes test/pptx/tables/moved-layouts.pptx | Bin 42747 -> 42753 bytes test/pptx/tables/output.pptx | Bin 29179 -> 29184 bytes test/pptx/tables/templated.pptx | Bin 42248 -> 42253 bytes test/pptx/two-column/all-text/deleted-layouts.pptx | Bin 30569 -> 30568 bytes test/pptx/two-column/all-text/moved-layouts.pptx | Bin 41257 -> 41256 bytes test/pptx/two-column/all-text/output.pptx | Bin 27691 -> 27689 bytes test/pptx/two-column/all-text/templated.pptx | Bin 40758 -> 40756 bytes .../two-column/text-and-image/deleted-layouts.pptx | Bin 48389 -> 48392 bytes .../two-column/text-and-image/moved-layouts.pptx | Bin 59084 -> 59086 bytes test/pptx/two-column/text-and-image/output.pptx | Bin 45518 -> 45520 bytes test/pptx/two-column/text-and-image/templated.pptx | Bin 58585 -> 58586 bytes 137 files changed, 1 insertion(+), 9 deletions(-) (limited to 'test/pptx') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 1680bc7ac..e3d31d099 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -348,15 +348,7 @@ instance Default PicProps where -------------------------------------------------- inlinesToParElems :: [Inline] -> Pres [ParaElem] -inlinesToParElems = concatMapM inlineToParElems . consolidateStrs - where - -- we combine Str + Space combinations, because this makes - -- the resulting ooxml much more compact, with fewer independent - -- text run elements - consolidateStrs [] = [] - consolidateStrs (Str t : Space : ils) = consolidateStrs (Str (t <> " ") : ils) - consolidateStrs (Space : Str t : ils) = consolidateStrs (Str (" " <> t) : ils) - consolidateStrs (il : ils) = il : consolidateStrs ils +inlinesToParElems ils = concatMapM inlineToParElems ils inlineToParElems :: Inline -> Pres [ParaElem] inlineToParElems (Str s) = do diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx index 41f13db87..05d4104b7 100644 Binary files a/test/pptx/background-image/deleted-layouts.pptx and b/test/pptx/background-image/deleted-layouts.pptx differ diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx index ca7a8a9d5..73b69e1d6 100644 Binary files a/test/pptx/background-image/moved-layouts.pptx and b/test/pptx/background-image/moved-layouts.pptx differ diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx index f3c2c7606..9738eefb8 100644 Binary files a/test/pptx/background-image/output.pptx and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/background-image/templated.pptx b/test/pptx/background-image/templated.pptx index 442fe3bdd..52d304957 100644 Binary files a/test/pptx/background-image/templated.pptx and b/test/pptx/background-image/templated.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx index 3dcc1d444..5038f2aaf 100644 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx index c63d94774..90353a560 100644 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 9377013a0..799c0f14a 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx index ed65b8f32..5e3afb5f8 100644 Binary files a/test/pptx/blanks/just-speaker-notes/templated.pptx and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx index 650da51db..7716e1cbf 100644 Binary files a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx index 45cf168a9..3dc6c817e 100644 Binary files a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx index 57c6e3b6e..1df3f9574 100644 Binary files a/test/pptx/blanks/nbsp-in-body/output.pptx and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/templated.pptx b/test/pptx/blanks/nbsp-in-body/templated.pptx index 8cc5d053a..1cf58a1bb 100644 Binary files a/test/pptx/blanks/nbsp-in-body/templated.pptx and b/test/pptx/blanks/nbsp-in-body/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx index 8b1d0a37b..7716e1cbf 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx index 45cf168a9..3dc6c817e 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx index 57c6e3b6e..e528091d7 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/output.pptx and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/templated.pptx b/test/pptx/blanks/nbsp-in-heading/templated.pptx index 8cc5d053a..1f2d91399 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/templated.pptx and b/test/pptx/blanks/nbsp-in-heading/templated.pptx differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx index 04e6dadd1..b49cd4896 100644 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx index caacdab47..c6806f37f 100644 Binary files a/test/pptx/code-custom/moved-layouts.pptx and b/test/pptx/code-custom/moved-layouts.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index f5aa05b41..a72bebbe2 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 160f85bdf..2bdb526fa 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx index bbfabede2..df7814599 100644 Binary files a/test/pptx/code/deleted-layouts.pptx and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx index 7950abbad..71e8560bd 100644 Binary files a/test/pptx/code/moved-layouts.pptx and b/test/pptx/code/moved-layouts.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index ce08a9c64..4b70df2c7 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index 2a37db25a..1285a9273 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx index 03ee6c408..27f9d9ac7 100644 Binary files a/test/pptx/comparison/both-columns/deleted-layouts.pptx and b/test/pptx/comparison/both-columns/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx index bb5f046fd..a658045ef 100644 Binary files a/test/pptx/comparison/both-columns/moved-layouts.pptx and b/test/pptx/comparison/both-columns/moved-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx index 345833b8b..560c7d41a 100644 Binary files a/test/pptx/comparison/both-columns/output.pptx and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx index 3dcc6274f..2fb38880d 100644 Binary files a/test/pptx/comparison/both-columns/templated.pptx and b/test/pptx/comparison/both-columns/templated.pptx differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx index 0ad383194..267c7cb69 100644 Binary files a/test/pptx/comparison/extra-image/deleted-layouts.pptx and b/test/pptx/comparison/extra-image/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx index 30bf2450b..b7023026c 100644 Binary files a/test/pptx/comparison/extra-image/moved-layouts.pptx and b/test/pptx/comparison/extra-image/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx index 464a07d88..06d632ee7 100644 Binary files a/test/pptx/comparison/extra-image/output.pptx and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx index 771b16cda..af84388c4 100644 Binary files a/test/pptx/comparison/extra-image/templated.pptx and b/test/pptx/comparison/extra-image/templated.pptx differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx index 03ee6c408..27f9d9ac7 100644 Binary files a/test/pptx/comparison/extra-text/deleted-layouts.pptx and b/test/pptx/comparison/extra-text/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx index 2541e97d3..a658045ef 100644 Binary files a/test/pptx/comparison/extra-text/moved-layouts.pptx and b/test/pptx/comparison/extra-text/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx index 345833b8b..560c7d41a 100644 Binary files a/test/pptx/comparison/extra-text/output.pptx and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx index 8d78e715a..2fb38880d 100644 Binary files a/test/pptx/comparison/extra-text/templated.pptx and b/test/pptx/comparison/extra-text/templated.pptx differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx index d2fab6c94..be30d8368 100644 Binary files a/test/pptx/comparison/non-text-first/deleted-layouts.pptx and b/test/pptx/comparison/non-text-first/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx index 16d59be78..c4879b7d5 100644 Binary files a/test/pptx/comparison/non-text-first/moved-layouts.pptx and b/test/pptx/comparison/non-text-first/moved-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx index 5f5d12d2f..099cf6729 100644 Binary files a/test/pptx/comparison/non-text-first/output.pptx and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx index 520021af3..31ac01f18 100644 Binary files a/test/pptx/comparison/non-text-first/templated.pptx and b/test/pptx/comparison/non-text-first/templated.pptx differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx index 5a31c333a..27620f05f 100644 Binary files a/test/pptx/comparison/one-column/deleted-layouts.pptx and b/test/pptx/comparison/one-column/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx index cce84cc9f..fc64d3af5 100644 Binary files a/test/pptx/comparison/one-column/moved-layouts.pptx and b/test/pptx/comparison/one-column/moved-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx index cc690844f..854a968af 100644 Binary files a/test/pptx/comparison/one-column/output.pptx and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx index 309a25d6e..9e671af1d 100644 Binary files a/test/pptx/comparison/one-column/templated.pptx and b/test/pptx/comparison/one-column/templated.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx index 1a94474ea..3cd09a916 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx index 32d76ca3d..8e76bc94c 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx index aea085efc..5c680e878 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/output.pptx and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx index 07becc7f8..bdde384a4 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/templated.pptx and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx index 4e834f056..376880b41 100644 Binary files a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx index 44a689c30..9e33d3163 100644 Binary files a/test/pptx/content-with-caption/image-text/moved-layouts.pptx and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx index e1595c428..c88030b94 100644 Binary files a/test/pptx/content-with-caption/image-text/output.pptx and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx index 58264a92d..a22e9ae3e 100644 Binary files a/test/pptx/content-with-caption/image-text/templated.pptx and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx index e548a7798..2dcb8b78e 100644 Binary files a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx index ca0e74a18..7d187a168 100644 Binary files a/test/pptx/content-with-caption/text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx index 3fdf9ea07..751121cf2 100644 Binary files a/test/pptx/content-with-caption/text-image/output.pptx and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx index bd96bd723..4f0aaaa7a 100644 Binary files a/test/pptx/content-with-caption/text-image/templated.pptx and b/test/pptx/content-with-caption/text-image/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx index f8903bbd4..79517481a 100644 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx index 59674d5dd..51608c2e9 100644 Binary files a/test/pptx/document-properties-short-desc/moved-layouts.pptx and b/test/pptx/document-properties-short-desc/moved-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx index 2c1ef0faa..02c241b89 100644 Binary files a/test/pptx/document-properties-short-desc/output.pptx and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/templated.pptx b/test/pptx/document-properties-short-desc/templated.pptx index 3e004942c..82ccc072c 100644 Binary files a/test/pptx/document-properties-short-desc/templated.pptx and b/test/pptx/document-properties-short-desc/templated.pptx differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx index 229cfc5a7..12f6570cf 100644 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx index 18d35eb26..9a9d4ac3e 100644 Binary files a/test/pptx/document-properties/moved-layouts.pptx and b/test/pptx/document-properties/moved-layouts.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx index 51f7a5116..cfd3261bc 100644 Binary files a/test/pptx/document-properties/output.pptx and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/document-properties/templated.pptx b/test/pptx/document-properties/templated.pptx index 6e37cd4a1..3d52d22df 100644 Binary files a/test/pptx/document-properties/templated.pptx and b/test/pptx/document-properties/templated.pptx differ diff --git a/test/pptx/footer/basic/output.pptx b/test/pptx/footer/basic/output.pptx index 8a2595016..db8814418 100644 Binary files a/test/pptx/footer/basic/output.pptx and b/test/pptx/footer/basic/output.pptx differ diff --git a/test/pptx/footer/fixed-date/output.pptx b/test/pptx/footer/fixed-date/output.pptx index b6857e8cf..85854a744 100644 Binary files a/test/pptx/footer/fixed-date/output.pptx and b/test/pptx/footer/fixed-date/output.pptx differ diff --git a/test/pptx/footer/higher-slide-number/output.pptx b/test/pptx/footer/higher-slide-number/output.pptx index 1e3bfc5aa..c5bc3d047 100644 Binary files a/test/pptx/footer/higher-slide-number/output.pptx and b/test/pptx/footer/higher-slide-number/output.pptx differ diff --git a/test/pptx/footer/no-title-slide/output.pptx b/test/pptx/footer/no-title-slide/output.pptx index a36a80406..d1475bf1f 100644 Binary files a/test/pptx/footer/no-title-slide/output.pptx and b/test/pptx/footer/no-title-slide/output.pptx differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx index 5da21f29c..9f0f41c37 100644 Binary files a/test/pptx/images/deleted-layouts.pptx and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx index a394237ca..f26ac9e8f 100644 Binary files a/test/pptx/images/moved-layouts.pptx and b/test/pptx/images/moved-layouts.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx index 0c4a774b1..993209a45 100644 Binary files a/test/pptx/images/output.pptx and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/images/templated.pptx b/test/pptx/images/templated.pptx index 9bb4567cf..06b337538 100644 Binary files a/test/pptx/images/templated.pptx and b/test/pptx/images/templated.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx index 180ac47b7..5a74826a4 100644 Binary files a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx index 1b6fc81b2..f20dd2906 100644 Binary files a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index 2cfffc0e9..d4f76f1e7 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index 7d9292f5c..f5ee2ff5f 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx index 6d68aafef..16bd85ffd 100644 Binary files a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx index 5bb33a6b4..054fe918e 100644 Binary files a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 4afae23d9..1b326461d 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index 62b0ab802..dee6e9b06 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx index d8fd26264..1670eada1 100644 Binary files a/test/pptx/lists/deleted-layouts.pptx and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx index 30319c6b8..f7590c5f9 100644 Binary files a/test/pptx/lists/moved-layouts.pptx and b/test/pptx/lists/moved-layouts.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index 7a7c9488b..95510e92e 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 9cece3499..7af437bfe 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx index 5f672b9d8..334fdea9c 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx index 159a8bb0f..3faabfd93 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx index f1c8c8f46..96b9907cc 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/output.pptx and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/templated.pptx b/test/pptx/slide-breaks-slide-level-1/templated.pptx index 7baaf5791..9f23f1d9f 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/templated.pptx and b/test/pptx/slide-breaks-slide-level-1/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx index cd0372c89..0492ee2ec 100644 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx index dc94f201b..f3e56652c 100644 Binary files a/test/pptx/slide-breaks-toc/moved-layouts.pptx and b/test/pptx/slide-breaks-toc/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index c9df30e6b..b3063b15e 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index 36ae13623..bcb2f8276 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx index b6cd32a04..827c7dfda 100644 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx index 48c50a709..241605754 100644 Binary files a/test/pptx/slide-breaks/moved-layouts.pptx and b/test/pptx/slide-breaks/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx index 30c3c1a8e..55c09a80e 100644 Binary files a/test/pptx/slide-breaks/output.pptx and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-breaks/templated.pptx b/test/pptx/slide-breaks/templated.pptx index 84581a358..f60f7da06 100644 Binary files a/test/pptx/slide-breaks/templated.pptx and b/test/pptx/slide-breaks/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx index 8903ff6fa..7bc7cfeee 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx index 65491db8c..602df1c77 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx index bdada1cad..f725760dc 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/output.pptx and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/templated.pptx b/test/pptx/slide-level-0/h1-with-image/templated.pptx index e1c85d948..b203ff671 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/templated.pptx and b/test/pptx/slide-level-0/h1-with-image/templated.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx index 8903ff6fa..7bc7cfeee 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx index 65491db8c..602df1c77 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx index bdada1cad..f725760dc 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/output.pptx and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/templated.pptx b/test/pptx/slide-level-0/h2-with-image/templated.pptx index e1c85d948..b203ff671 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/templated.pptx and b/test/pptx/slide-level-0/h2-with-image/templated.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 30bd36e5d..9010ba04a 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx index b05079ef2..ca53605b7 100644 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index 41e3148cb..607115858 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx index 9cdc0ef9f..3be3ed0af 100644 Binary files a/test/pptx/speaker-notes-after-metadata/templated.pptx and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 54de85128..2c2a0936b 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx index 4e4a854e5..a9c8bfa0a 100644 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index 96b136ef9..ff403aa1c 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx index abdc71ebc..15435c45a 100644 Binary files a/test/pptx/speaker-notes-afterheader/templated.pptx and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index 99e499f4d..f6abb0b27 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx index 49f7360c7..6a770fc75 100644 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 3a426d29a..7e56147f1 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index 8e26e7581..3184ff74e 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index a8014c666..5429b88e0 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx index be5c383c3..13e34698d 100644 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index 0fe2b7783..74041a40d 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx index 70e1a2c88..80a3e3dea 100644 Binary files a/test/pptx/speaker-notes/templated.pptx and b/test/pptx/speaker-notes/templated.pptx differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx index 8692da129..7bfe9868f 100644 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx index 7e1a68a0d..0100365ec 100644 Binary files a/test/pptx/start-numbering-at/moved-layouts.pptx and b/test/pptx/start-numbering-at/moved-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index 95a0c8ef4..3ba9a236a 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index b4302f6d5..8a144d601 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx index ebad0c49b..163d4ca5e 100644 Binary files a/test/pptx/tables/deleted-layouts.pptx and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx index 2ad4646a6..1b0e606da 100644 Binary files a/test/pptx/tables/moved-layouts.pptx and b/test/pptx/tables/moved-layouts.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx index 81f7a21c1..1c89d8032 100644 Binary files a/test/pptx/tables/output.pptx and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/tables/templated.pptx b/test/pptx/tables/templated.pptx index 538bec0fb..5755bfe9d 100644 Binary files a/test/pptx/tables/templated.pptx and b/test/pptx/tables/templated.pptx differ diff --git a/test/pptx/two-column/all-text/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx index 58400da56..1d7bd87d3 100644 Binary files a/test/pptx/two-column/all-text/deleted-layouts.pptx and b/test/pptx/two-column/all-text/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx index 7e94ede93..71760268c 100644 Binary files a/test/pptx/two-column/all-text/moved-layouts.pptx and b/test/pptx/two-column/all-text/moved-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/output.pptx b/test/pptx/two-column/all-text/output.pptx index f5d871c53..396dc2a74 100644 Binary files a/test/pptx/two-column/all-text/output.pptx and b/test/pptx/two-column/all-text/output.pptx differ diff --git a/test/pptx/two-column/all-text/templated.pptx b/test/pptx/two-column/all-text/templated.pptx index d5f563006..8901695b1 100644 Binary files a/test/pptx/two-column/all-text/templated.pptx and b/test/pptx/two-column/all-text/templated.pptx differ diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx index 43ced4431..297fd6bad 100644 Binary files a/test/pptx/two-column/text-and-image/deleted-layouts.pptx and b/test/pptx/two-column/text-and-image/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx index 231723f10..c9a6e577e 100644 Binary files a/test/pptx/two-column/text-and-image/moved-layouts.pptx and b/test/pptx/two-column/text-and-image/moved-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx index bb6af0d74..bfd532ed9 100644 Binary files a/test/pptx/two-column/text-and-image/output.pptx and b/test/pptx/two-column/text-and-image/output.pptx differ diff --git a/test/pptx/two-column/text-and-image/templated.pptx b/test/pptx/two-column/text-and-image/templated.pptx index 4014b0bf1..23e6b283f 100644 Binary files a/test/pptx/two-column/text-and-image/templated.pptx and b/test/pptx/two-column/text-and-image/templated.pptx differ -- cgit v1.2.3 From b8d460eeabe97756d49e4bc5f00c6bb084b69aa5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 4 Oct 2021 12:18:18 -0700 Subject: Powerpoint writer: consolidate text runs when possible. This slims down the output files by avoiding unnecessary text run elements. Updated golden tests. --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 11 ++++++++--- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 2 +- test/pptx/background-image/deleted-layouts.pptx | Bin 56282 -> 56230 bytes test/pptx/background-image/moved-layouts.pptx | Bin 66987 -> 66932 bytes test/pptx/background-image/output.pptx | Bin 53408 -> 53358 bytes test/pptx/background-image/templated.pptx | Bin 66487 -> 66433 bytes .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35178 -> 35147 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45870 -> 45837 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32297 -> 32267 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 45365 -> 45333 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 32092 -> 32085 bytes test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 42780 -> 42772 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 29211 -> 29205 bytes test/pptx/blanks/nbsp-in-body/templated.pptx | Bin 42280 -> 42273 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 32092 -> 32085 bytes test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 42780 -> 42772 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 29211 -> 29205 bytes test/pptx/blanks/nbsp-in-heading/templated.pptx | Bin 42280 -> 42273 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 32717 -> 32697 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 43405 -> 43385 bytes test/pptx/code-custom/output.pptx | Bin 29836 -> 29817 bytes test/pptx/code-custom/templated.pptx | Bin 42905 -> 42884 bytes test/pptx/code/deleted-layouts.pptx | Bin 32716 -> 32695 bytes test/pptx/code/moved-layouts.pptx | Bin 43405 -> 43383 bytes test/pptx/code/output.pptx | Bin 29835 -> 29815 bytes test/pptx/code/templated.pptx | Bin 42905 -> 42882 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 47453 -> 47441 bytes .../pptx/comparison/both-columns/moved-layouts.pptx | Bin 58172 -> 58159 bytes test/pptx/comparison/both-columns/output.pptx | Bin 44581 -> 44570 bytes test/pptx/comparison/both-columns/templated.pptx | Bin 57674 -> 57662 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 47482 -> 47470 bytes test/pptx/comparison/extra-image/moved-layouts.pptx | Bin 58200 -> 58185 bytes test/pptx/comparison/extra-image/output.pptx | Bin 44610 -> 44599 bytes test/pptx/comparison/extra-image/templated.pptx | Bin 57702 -> 57688 bytes .../pptx/comparison/extra-text/deleted-layouts.pptx | Bin 47453 -> 47441 bytes test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 58172 -> 58159 bytes test/pptx/comparison/extra-text/output.pptx | Bin 44581 -> 44570 bytes test/pptx/comparison/extra-text/templated.pptx | Bin 57674 -> 57662 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 47366 -> 47355 bytes .../comparison/non-text-first/moved-layouts.pptx | Bin 58065 -> 58050 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 44494 -> 44484 bytes test/pptx/comparison/non-text-first/templated.pptx | Bin 57567 -> 57553 bytes .../pptx/comparison/one-column/deleted-layouts.pptx | Bin 30785 -> 30780 bytes test/pptx/comparison/one-column/moved-layouts.pptx | Bin 41506 -> 41499 bytes test/pptx/comparison/one-column/output.pptx | Bin 27906 -> 27902 bytes test/pptx/comparison/one-column/templated.pptx | Bin 41006 -> 41000 bytes .../heading-text-image/deleted-layouts.pptx | Bin 47198 -> 47189 bytes .../heading-text-image/moved-layouts.pptx | Bin 57896 -> 57887 bytes .../heading-text-image/output.pptx | Bin 44326 -> 44318 bytes .../heading-text-image/templated.pptx | Bin 57398 -> 57390 bytes .../image-text/deleted-layouts.pptx | Bin 47896 -> 47891 bytes .../image-text/moved-layouts.pptx | Bin 58584 -> 58578 bytes .../content-with-caption/image-text/output.pptx | Bin 45022 -> 45019 bytes .../content-with-caption/image-text/templated.pptx | Bin 58084 -> 58079 bytes .../text-image/deleted-layouts.pptx | Bin 47137 -> 47129 bytes .../text-image/moved-layouts.pptx | Bin 57836 -> 57827 bytes .../content-with-caption/text-image/output.pptx | Bin 44265 -> 44258 bytes .../content-with-caption/text-image/templated.pptx | Bin 57338 -> 57330 bytes .../deleted-layouts.pptx | Bin 31490 -> 31483 bytes .../moved-layouts.pptx | Bin 42178 -> 42171 bytes .../pptx/document-properties-short-desc/output.pptx | Bin 28619 -> 28613 bytes .../document-properties-short-desc/templated.pptx | Bin 41678 -> 41671 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 31894 -> 31886 bytes test/pptx/document-properties/moved-layouts.pptx | Bin 42582 -> 42573 bytes test/pptx/document-properties/output.pptx | Bin 29025 -> 29015 bytes test/pptx/document-properties/templated.pptx | Bin 42082 -> 42073 bytes test/pptx/footer/basic/output.pptx | Bin 52775 -> 52727 bytes test/pptx/footer/fixed-date/output.pptx | Bin 51397 -> 51354 bytes test/pptx/footer/higher-slide-number/output.pptx | Bin 52790 -> 52740 bytes test/pptx/footer/no-title-slide/output.pptx | Bin 52362 -> 52314 bytes test/pptx/images/deleted-layouts.pptx | Bin 49121 -> 49113 bytes test/pptx/images/moved-layouts.pptx | Bin 59809 -> 59801 bytes test/pptx/images/output.pptx | Bin 46244 -> 46235 bytes test/pptx/images/templated.pptx | Bin 59308 -> 59299 bytes .../with-flag/deleted-layouts.pptx | Bin 80172 -> 80042 bytes .../incremental-lists/with-flag/moved-layouts.pptx | Bin 90917 -> 90782 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77298 -> 77169 bytes .../pptx/incremental-lists/with-flag/templated.pptx | Bin 90414 -> 90280 bytes .../without-flag/deleted-layouts.pptx | Bin 78405 -> 78282 bytes .../without-flag/moved-layouts.pptx | Bin 89148 -> 89020 bytes .../pptx/incremental-lists/without-flag/output.pptx | Bin 75533 -> 75411 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88645 -> 88518 bytes test/pptx/lists/deleted-layouts.pptx | Bin 31545 -> 31540 bytes test/pptx/lists/moved-layouts.pptx | Bin 42233 -> 42230 bytes test/pptx/lists/output.pptx | Bin 28667 -> 28664 bytes test/pptx/lists/templated.pptx | Bin 41733 -> 41729 bytes .../slide-breaks-slide-level-1/deleted-layouts.pptx | Bin 32238 -> 32233 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 42926 -> 42923 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 29357 -> 29354 bytes test/pptx/slide-breaks-slide-level-1/templated.pptx | Bin 42426 -> 42422 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 34012 -> 34006 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 44701 -> 44696 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31133 -> 31129 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 44201 -> 44195 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 33062 -> 33056 bytes test/pptx/slide-breaks/moved-layouts.pptx | Bin 43751 -> 43746 bytes test/pptx/slide-breaks/output.pptx | Bin 30183 -> 30179 bytes test/pptx/slide-breaks/templated.pptx | Bin 43250 -> 43244 bytes .../h1-with-image/deleted-layouts.pptx | Bin 47118 -> 47114 bytes .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 57804 -> 57800 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 44245 -> 44242 bytes .../pptx/slide-level-0/h1-with-image/templated.pptx | Bin 57306 -> 57302 bytes .../h2-with-image/deleted-layouts.pptx | Bin 47118 -> 47114 bytes .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 57804 -> 57800 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 44245 -> 44242 bytes .../pptx/slide-level-0/h2-with-image/templated.pptx | Bin 57306 -> 57302 bytes .../deleted-layouts.pptx | Bin 34504 -> 34486 bytes .../speaker-notes-after-metadata/moved-layouts.pptx | Bin 45193 -> 45176 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31634 -> 31617 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 44690 -> 44673 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33532 -> 33507 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44220 -> 44195 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30653 -> 30629 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 43719 -> 43693 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54429 -> 54374 bytes .../pptx/speaker-notes-afterseps/moved-layouts.pptx | Bin 65119 -> 65064 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51548 -> 51494 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64614 -> 64558 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38236 -> 38206 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 48929 -> 48899 bytes test/pptx/speaker-notes/output.pptx | Bin 35358 -> 35329 bytes test/pptx/speaker-notes/templated.pptx | Bin 48423 -> 48392 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 31521 -> 31502 bytes test/pptx/start-numbering-at/moved-layouts.pptx | Bin 42209 -> 42192 bytes test/pptx/start-numbering-at/output.pptx | Bin 28643 -> 28626 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41709 -> 41691 bytes test/pptx/tables/deleted-layouts.pptx | Bin 32065 -> 32040 bytes test/pptx/tables/moved-layouts.pptx | Bin 42753 -> 42729 bytes test/pptx/tables/output.pptx | Bin 29184 -> 29160 bytes test/pptx/tables/templated.pptx | Bin 42253 -> 42228 bytes test/pptx/two-column/all-text/deleted-layouts.pptx | Bin 30568 -> 30567 bytes test/pptx/two-column/all-text/moved-layouts.pptx | Bin 41256 -> 41255 bytes test/pptx/two-column/all-text/output.pptx | Bin 27689 -> 27689 bytes test/pptx/two-column/all-text/templated.pptx | Bin 40756 -> 40754 bytes .../two-column/text-and-image/deleted-layouts.pptx | Bin 48392 -> 48381 bytes .../two-column/text-and-image/moved-layouts.pptx | Bin 59086 -> 59075 bytes test/pptx/two-column/text-and-image/output.pptx | Bin 45520 -> 45510 bytes test/pptx/two-column/text-and-image/templated.pptx | Bin 58586 -> 58574 bytes 138 files changed, 9 insertions(+), 4 deletions(-) (limited to 'test/pptx') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index f4700e8c1..42ce780fa 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -1088,6 +1088,12 @@ makePicElements layout picProps mInfo titleText alt = do return [picShape, cap] else return [picShape] +consolidateRuns :: [ParaElem] -> [ParaElem] +consolidateRuns [] = [] +consolidateRuns (Run pr1 s1 : Run pr2 s2 : xs) + | pr1 == pr2 = consolidateRuns (Run pr1 (s1 <> s2) : xs) +consolidateRuns (x:xs) = x : consolidateRuns xs + paraElemToElements :: PandocMonad m => ParaElem -> P m [Content] paraElemToElements Break = return [Elem $ mknode "a:br" [] ()] @@ -1223,9 +1229,8 @@ paragraphToElement par = do [mknode "a:buAutoNum" (autoNumAttrs attrs') ()] Nothing -> [mknode "a:buNone" [] ()] ) - paras <- mapM paraElemToElements (paraElems par) - return $ mknode "a:p" [] $ - [Elem $ mknode "a:pPr" attrs props] <> concat paras + paras <- mconcat <$> mapM paraElemToElements (consolidateRuns (paraElems par)) + return $ mknode "a:p" [] $ [Elem $ mknode "a:pPr" attrs props] <> paras shapeToElement :: PandocMonad m => Element -> Shape -> P m (Maybe ShapeId, Element) shapeToElement layout (TextBox paras) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index e3d31d099..99b016a63 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -348,7 +348,7 @@ instance Default PicProps where -------------------------------------------------- inlinesToParElems :: [Inline] -> Pres [ParaElem] -inlinesToParElems ils = concatMapM inlineToParElems ils +inlinesToParElems = concatMapM inlineToParElems inlineToParElems :: Inline -> Pres [ParaElem] inlineToParElems (Str s) = do diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx index 05d4104b7..e46a58ad7 100644 Binary files a/test/pptx/background-image/deleted-layouts.pptx and b/test/pptx/background-image/deleted-layouts.pptx differ diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx index 73b69e1d6..98fe33095 100644 Binary files a/test/pptx/background-image/moved-layouts.pptx and b/test/pptx/background-image/moved-layouts.pptx differ diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx index 9738eefb8..abe82ebc2 100644 Binary files a/test/pptx/background-image/output.pptx and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/background-image/templated.pptx b/test/pptx/background-image/templated.pptx index 52d304957..0f2879022 100644 Binary files a/test/pptx/background-image/templated.pptx and b/test/pptx/background-image/templated.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx index 5038f2aaf..f729c3ce6 100644 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx index 90353a560..dfae6a645 100644 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 799c0f14a..0c4ed20fa 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx index 5e3afb5f8..f9eca6f8c 100644 Binary files a/test/pptx/blanks/just-speaker-notes/templated.pptx and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx index 7716e1cbf..dcd88cb24 100644 Binary files a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx index 3dc6c817e..0a69853fa 100644 Binary files a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx index 1df3f9574..6265c842f 100644 Binary files a/test/pptx/blanks/nbsp-in-body/output.pptx and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/templated.pptx b/test/pptx/blanks/nbsp-in-body/templated.pptx index 1cf58a1bb..758502dd0 100644 Binary files a/test/pptx/blanks/nbsp-in-body/templated.pptx and b/test/pptx/blanks/nbsp-in-body/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx index 7716e1cbf..dcd88cb24 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx index 3dc6c817e..0a69853fa 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx index e528091d7..6265c842f 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/output.pptx and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/templated.pptx b/test/pptx/blanks/nbsp-in-heading/templated.pptx index 1f2d91399..758502dd0 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/templated.pptx and b/test/pptx/blanks/nbsp-in-heading/templated.pptx differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx index b49cd4896..f8b1c789e 100644 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx index c6806f37f..810b46dd1 100644 Binary files a/test/pptx/code-custom/moved-layouts.pptx and b/test/pptx/code-custom/moved-layouts.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index a72bebbe2..ded8f1125 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 2bdb526fa..8bb0df1ff 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx index df7814599..3127e20e5 100644 Binary files a/test/pptx/code/deleted-layouts.pptx and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx index 71e8560bd..7a2e3b7ac 100644 Binary files a/test/pptx/code/moved-layouts.pptx and b/test/pptx/code/moved-layouts.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index 4b70df2c7..e700bc268 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index 1285a9273..44f34cd64 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx index 27f9d9ac7..6d80e275f 100644 Binary files a/test/pptx/comparison/both-columns/deleted-layouts.pptx and b/test/pptx/comparison/both-columns/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx index a658045ef..2840e0535 100644 Binary files a/test/pptx/comparison/both-columns/moved-layouts.pptx and b/test/pptx/comparison/both-columns/moved-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx index 560c7d41a..47f807754 100644 Binary files a/test/pptx/comparison/both-columns/output.pptx and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx index 2fb38880d..945bc6dc4 100644 Binary files a/test/pptx/comparison/both-columns/templated.pptx and b/test/pptx/comparison/both-columns/templated.pptx differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx index 267c7cb69..771ad409a 100644 Binary files a/test/pptx/comparison/extra-image/deleted-layouts.pptx and b/test/pptx/comparison/extra-image/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx index b7023026c..2418e98c1 100644 Binary files a/test/pptx/comparison/extra-image/moved-layouts.pptx and b/test/pptx/comparison/extra-image/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx index 06d632ee7..f700e09a8 100644 Binary files a/test/pptx/comparison/extra-image/output.pptx and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx index af84388c4..2e48ffe87 100644 Binary files a/test/pptx/comparison/extra-image/templated.pptx and b/test/pptx/comparison/extra-image/templated.pptx differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx index 27f9d9ac7..c87b3f3ee 100644 Binary files a/test/pptx/comparison/extra-text/deleted-layouts.pptx and b/test/pptx/comparison/extra-text/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx index a658045ef..2840e0535 100644 Binary files a/test/pptx/comparison/extra-text/moved-layouts.pptx and b/test/pptx/comparison/extra-text/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx index 560c7d41a..47f807754 100644 Binary files a/test/pptx/comparison/extra-text/output.pptx and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx index 2fb38880d..debb62d52 100644 Binary files a/test/pptx/comparison/extra-text/templated.pptx and b/test/pptx/comparison/extra-text/templated.pptx differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx index be30d8368..95b2e3a3c 100644 Binary files a/test/pptx/comparison/non-text-first/deleted-layouts.pptx and b/test/pptx/comparison/non-text-first/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx index c4879b7d5..5a60028d4 100644 Binary files a/test/pptx/comparison/non-text-first/moved-layouts.pptx and b/test/pptx/comparison/non-text-first/moved-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx index 099cf6729..c8a2bd0e3 100644 Binary files a/test/pptx/comparison/non-text-first/output.pptx and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx index 31ac01f18..a19b469b1 100644 Binary files a/test/pptx/comparison/non-text-first/templated.pptx and b/test/pptx/comparison/non-text-first/templated.pptx differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx index 27620f05f..6a705c735 100644 Binary files a/test/pptx/comparison/one-column/deleted-layouts.pptx and b/test/pptx/comparison/one-column/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx index fc64d3af5..f456151a5 100644 Binary files a/test/pptx/comparison/one-column/moved-layouts.pptx and b/test/pptx/comparison/one-column/moved-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx index 854a968af..e70dd2326 100644 Binary files a/test/pptx/comparison/one-column/output.pptx and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx index 9e671af1d..fa5c2dc87 100644 Binary files a/test/pptx/comparison/one-column/templated.pptx and b/test/pptx/comparison/one-column/templated.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx index 3cd09a916..d01a8f9d8 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx index 8e76bc94c..69cb830a9 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx index 5c680e878..0677879aa 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/output.pptx and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx index bdde384a4..059d4f460 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/templated.pptx and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx index 376880b41..e9aebd579 100644 Binary files a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx index 9e33d3163..c27f1e1cf 100644 Binary files a/test/pptx/content-with-caption/image-text/moved-layouts.pptx and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx index c88030b94..f461b6ed3 100644 Binary files a/test/pptx/content-with-caption/image-text/output.pptx and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx index a22e9ae3e..a9c6aa43d 100644 Binary files a/test/pptx/content-with-caption/image-text/templated.pptx and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx index 2dcb8b78e..f15e674c7 100644 Binary files a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx index 7d187a168..39566cd7f 100644 Binary files a/test/pptx/content-with-caption/text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx index 751121cf2..be376c1ed 100644 Binary files a/test/pptx/content-with-caption/text-image/output.pptx and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx index 4f0aaaa7a..185314bf4 100644 Binary files a/test/pptx/content-with-caption/text-image/templated.pptx and b/test/pptx/content-with-caption/text-image/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx index 79517481a..a6da0c338 100644 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx index 51608c2e9..4cff1d486 100644 Binary files a/test/pptx/document-properties-short-desc/moved-layouts.pptx and b/test/pptx/document-properties-short-desc/moved-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx index 02c241b89..737ca7e8d 100644 Binary files a/test/pptx/document-properties-short-desc/output.pptx and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/templated.pptx b/test/pptx/document-properties-short-desc/templated.pptx index 82ccc072c..4feccdac7 100644 Binary files a/test/pptx/document-properties-short-desc/templated.pptx and b/test/pptx/document-properties-short-desc/templated.pptx differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx index 12f6570cf..a2a58af34 100644 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx index 9a9d4ac3e..e24d904a2 100644 Binary files a/test/pptx/document-properties/moved-layouts.pptx and b/test/pptx/document-properties/moved-layouts.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx index cfd3261bc..ef05c01b5 100644 Binary files a/test/pptx/document-properties/output.pptx and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/document-properties/templated.pptx b/test/pptx/document-properties/templated.pptx index 3d52d22df..df6acb70c 100644 Binary files a/test/pptx/document-properties/templated.pptx and b/test/pptx/document-properties/templated.pptx differ diff --git a/test/pptx/footer/basic/output.pptx b/test/pptx/footer/basic/output.pptx index db8814418..2af46108c 100644 Binary files a/test/pptx/footer/basic/output.pptx and b/test/pptx/footer/basic/output.pptx differ diff --git a/test/pptx/footer/fixed-date/output.pptx b/test/pptx/footer/fixed-date/output.pptx index 85854a744..678ecdb87 100644 Binary files a/test/pptx/footer/fixed-date/output.pptx and b/test/pptx/footer/fixed-date/output.pptx differ diff --git a/test/pptx/footer/higher-slide-number/output.pptx b/test/pptx/footer/higher-slide-number/output.pptx index c5bc3d047..651491107 100644 Binary files a/test/pptx/footer/higher-slide-number/output.pptx and b/test/pptx/footer/higher-slide-number/output.pptx differ diff --git a/test/pptx/footer/no-title-slide/output.pptx b/test/pptx/footer/no-title-slide/output.pptx index d1475bf1f..c470cbb94 100644 Binary files a/test/pptx/footer/no-title-slide/output.pptx and b/test/pptx/footer/no-title-slide/output.pptx differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx index 9f0f41c37..3c3ed787f 100644 Binary files a/test/pptx/images/deleted-layouts.pptx and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx index f26ac9e8f..b22f3652a 100644 Binary files a/test/pptx/images/moved-layouts.pptx and b/test/pptx/images/moved-layouts.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx index 993209a45..9b04881f3 100644 Binary files a/test/pptx/images/output.pptx and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/images/templated.pptx b/test/pptx/images/templated.pptx index 06b337538..cad0b2f04 100644 Binary files a/test/pptx/images/templated.pptx and b/test/pptx/images/templated.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx index 5a74826a4..3e92d4dab 100644 Binary files a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx index f20dd2906..050842865 100644 Binary files a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index d4f76f1e7..1ca1dbf17 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index f5ee2ff5f..4ddf6bb75 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx index 16bd85ffd..4816c0b39 100644 Binary files a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx index 054fe918e..4f27db07b 100644 Binary files a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 1b326461d..6f7261ba3 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index dee6e9b06..ca5c9fdab 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx index 1670eada1..d064b7fd5 100644 Binary files a/test/pptx/lists/deleted-layouts.pptx and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx index f7590c5f9..8a9c9ec59 100644 Binary files a/test/pptx/lists/moved-layouts.pptx and b/test/pptx/lists/moved-layouts.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index 95510e92e..94a424f42 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 7af437bfe..52097489f 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx index 334fdea9c..b6b004cd6 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx index 3faabfd93..229e4c32a 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx index 96b9907cc..cb65ab335 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/output.pptx and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/templated.pptx b/test/pptx/slide-breaks-slide-level-1/templated.pptx index 9f23f1d9f..ca2e844cc 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/templated.pptx and b/test/pptx/slide-breaks-slide-level-1/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx index 0492ee2ec..e3b3b2807 100644 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx index f3e56652c..ecc942803 100644 Binary files a/test/pptx/slide-breaks-toc/moved-layouts.pptx and b/test/pptx/slide-breaks-toc/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index b3063b15e..788cdf148 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index bcb2f8276..d11744079 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx index 827c7dfda..ada3453b0 100644 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx index 241605754..0fe10f443 100644 Binary files a/test/pptx/slide-breaks/moved-layouts.pptx and b/test/pptx/slide-breaks/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx index 55c09a80e..7c2c7db5e 100644 Binary files a/test/pptx/slide-breaks/output.pptx and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-breaks/templated.pptx b/test/pptx/slide-breaks/templated.pptx index f60f7da06..5bf186f4e 100644 Binary files a/test/pptx/slide-breaks/templated.pptx and b/test/pptx/slide-breaks/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx index 7bc7cfeee..478dde788 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx index 602df1c77..63b411888 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx index f725760dc..70fc6aee2 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/output.pptx and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/templated.pptx b/test/pptx/slide-level-0/h1-with-image/templated.pptx index b203ff671..7a023480f 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/templated.pptx and b/test/pptx/slide-level-0/h1-with-image/templated.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx index 7bc7cfeee..478dde788 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx index 602df1c77..63b411888 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx index f725760dc..70fc6aee2 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/output.pptx and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/templated.pptx b/test/pptx/slide-level-0/h2-with-image/templated.pptx index b203ff671..7a023480f 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/templated.pptx and b/test/pptx/slide-level-0/h2-with-image/templated.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 9010ba04a..07e21ef02 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx index ca53605b7..d6673aac0 100644 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index 607115858..f68d6f0ef 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx index 3be3ed0af..fd95c935e 100644 Binary files a/test/pptx/speaker-notes-after-metadata/templated.pptx and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 2c2a0936b..0ccdd72b7 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx index a9c8bfa0a..81f0a56cb 100644 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index ff403aa1c..9df78756b 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx index 15435c45a..b85f22961 100644 Binary files a/test/pptx/speaker-notes-afterheader/templated.pptx and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index f6abb0b27..33dedf2c3 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx index 6a770fc75..28bcf3887 100644 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 7e56147f1..99110d3ca 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index 3184ff74e..daf8e2175 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index 5429b88e0..5f407086a 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx index 13e34698d..83d5ed0af 100644 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index 74041a40d..6ae003d7a 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx index 80a3e3dea..f35bf5d88 100644 Binary files a/test/pptx/speaker-notes/templated.pptx and b/test/pptx/speaker-notes/templated.pptx differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx index 7bfe9868f..d99fedfa6 100644 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx index 0100365ec..98db3ec74 100644 Binary files a/test/pptx/start-numbering-at/moved-layouts.pptx and b/test/pptx/start-numbering-at/moved-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index 3ba9a236a..bc74ec599 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index 8a144d601..4f191a06e 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx index 163d4ca5e..7ad714058 100644 Binary files a/test/pptx/tables/deleted-layouts.pptx and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx index 1b0e606da..9628717d7 100644 Binary files a/test/pptx/tables/moved-layouts.pptx and b/test/pptx/tables/moved-layouts.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx index 1c89d8032..4398e35be 100644 Binary files a/test/pptx/tables/output.pptx and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/tables/templated.pptx b/test/pptx/tables/templated.pptx index 5755bfe9d..7259e15dd 100644 Binary files a/test/pptx/tables/templated.pptx and b/test/pptx/tables/templated.pptx differ diff --git a/test/pptx/two-column/all-text/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx index 1d7bd87d3..a321128b5 100644 Binary files a/test/pptx/two-column/all-text/deleted-layouts.pptx and b/test/pptx/two-column/all-text/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx index 71760268c..90b1d9254 100644 Binary files a/test/pptx/two-column/all-text/moved-layouts.pptx and b/test/pptx/two-column/all-text/moved-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/output.pptx b/test/pptx/two-column/all-text/output.pptx index 396dc2a74..45f651ceb 100644 Binary files a/test/pptx/two-column/all-text/output.pptx and b/test/pptx/two-column/all-text/output.pptx differ diff --git a/test/pptx/two-column/all-text/templated.pptx b/test/pptx/two-column/all-text/templated.pptx index 8901695b1..01a3cdb0c 100644 Binary files a/test/pptx/two-column/all-text/templated.pptx and b/test/pptx/two-column/all-text/templated.pptx differ diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx index 297fd6bad..46274ffac 100644 Binary files a/test/pptx/two-column/text-and-image/deleted-layouts.pptx and b/test/pptx/two-column/text-and-image/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx index c9a6e577e..c25331e23 100644 Binary files a/test/pptx/two-column/text-and-image/moved-layouts.pptx and b/test/pptx/two-column/text-and-image/moved-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx index bfd532ed9..aab0b3b59 100644 Binary files a/test/pptx/two-column/text-and-image/output.pptx and b/test/pptx/two-column/text-and-image/output.pptx differ diff --git a/test/pptx/two-column/text-and-image/templated.pptx b/test/pptx/two-column/text-and-image/templated.pptx index 23e6b283f..5cae9b43b 100644 Binary files a/test/pptx/two-column/text-and-image/templated.pptx and b/test/pptx/two-column/text-and-image/templated.pptx differ -- cgit v1.2.3 From aa78765bf9d21b3a617a9eafba59dd59e362aa6b Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 7 Oct 2021 15:25:15 +0100 Subject: pptx: Remove excessive layout tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When I added the tests for moved layouts and deleted layouts, I added them to all tests. However, this doesn’t really give a lot more info than having single tests, and the extra tests take up time and disk space. This commit removes the moved-layouts and deleted-layouts tests, in favour of a single test for each of those scenarios. --- test/Tests/Writers/Powerpoint.hs | 35 +++++++++------------ test/pptx/background-image/deleted-layouts.pptx | Bin 56230 -> 0 bytes test/pptx/background-image/moved-layouts.pptx | Bin 66932 -> 0 bytes .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35147 -> 0 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45837 -> 0 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 32085 -> 0 bytes test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 42772 -> 0 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 32085 -> 0 bytes .../pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 42772 -> 0 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 32697 -> 0 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 43385 -> 0 bytes test/pptx/code/deleted-layouts.pptx | Bin 32695 -> 0 bytes test/pptx/code/moved-layouts.pptx | Bin 43383 -> 0 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 47441 -> 0 bytes .../comparison/both-columns/moved-layouts.pptx | Bin 58159 -> 0 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 47470 -> 0 bytes .../pptx/comparison/extra-image/moved-layouts.pptx | Bin 58185 -> 0 bytes .../comparison/extra-text/deleted-layouts.pptx | Bin 47441 -> 0 bytes test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 58159 -> 0 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 47355 -> 0 bytes .../comparison/non-text-first/moved-layouts.pptx | Bin 58050 -> 0 bytes .../comparison/one-column/deleted-layouts.pptx | Bin 30780 -> 0 bytes test/pptx/comparison/one-column/moved-layouts.pptx | Bin 41499 -> 0 bytes .../heading-text-image/deleted-layouts.pptx | Bin 47189 -> 0 bytes .../heading-text-image/moved-layouts.pptx | Bin 57887 -> 0 bytes .../image-text/deleted-layouts.pptx | Bin 47891 -> 0 bytes .../image-text/moved-layouts.pptx | Bin 58578 -> 0 bytes .../text-image/deleted-layouts.pptx | Bin 47129 -> 0 bytes .../text-image/moved-layouts.pptx | Bin 57827 -> 0 bytes .../deleted-layouts.pptx | Bin 31483 -> 0 bytes .../moved-layouts.pptx | Bin 42171 -> 0 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 31886 -> 0 bytes test/pptx/document-properties/moved-layouts.pptx | Bin 42573 -> 0 bytes test/pptx/endnotes-toc/deleted-layouts.pptx | Bin 32280 -> 0 bytes test/pptx/endnotes-toc/moved-layouts.pptx | Bin 42967 -> 0 bytes test/pptx/endnotes/deleted-layouts.pptx | Bin 31458 -> 0 bytes test/pptx/endnotes/moved-layouts.pptx | Bin 42146 -> 0 bytes test/pptx/images/deleted-layouts.pptx | Bin 49113 -> 0 bytes test/pptx/images/moved-layouts.pptx | Bin 59801 -> 0 bytes .../with-flag/deleted-layouts.pptx | Bin 80042 -> 0 bytes .../incremental-lists/with-flag/moved-layouts.pptx | Bin 90782 -> 0 bytes .../without-flag/deleted-layouts.pptx | Bin 78282 -> 0 bytes .../without-flag/moved-layouts.pptx | Bin 89020 -> 0 bytes test/pptx/inline-formatting/deleted-layouts.pptx | Bin 30651 -> 0 bytes test/pptx/inline-formatting/moved-layouts.pptx | Bin 41339 -> 0 bytes test/pptx/layouts/deleted.pptx | Bin 0 -> 55694 bytes test/pptx/layouts/input.native | 23 ++++++++++++++ test/pptx/layouts/moved.pptx | Bin 0 -> 66430 bytes test/pptx/lists/deleted-layouts.pptx | Bin 31540 -> 0 bytes test/pptx/lists/moved-layouts.pptx | Bin 42230 -> 0 bytes test/pptx/raw-ooxml/deleted-layouts.pptx | Bin 31438 -> 0 bytes test/pptx/raw-ooxml/moved-layouts.pptx | Bin 42126 -> 0 bytes test/pptx/remove-empty-slides/deleted-layouts.pptx | Bin 47866 -> 0 bytes test/pptx/remove-empty-slides/moved-layouts.pptx | Bin 58553 -> 0 bytes .../deleted-layouts.pptx | Bin 32233 -> 0 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 42923 -> 0 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 34006 -> 0 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 44696 -> 0 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 33056 -> 0 bytes test/pptx/slide-breaks/moved-layouts.pptx | Bin 43746 -> 0 bytes .../h1-h2-with-table/deleted-layouts.pptx | Bin 30786 -> 0 bytes .../h1-h2-with-table/moved-layouts.pptx | Bin 41479 -> 0 bytes .../h1-with-image/deleted-layouts.pptx | Bin 47114 -> 0 bytes .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 57800 -> 0 bytes .../h1-with-table/deleted-layouts.pptx | Bin 30693 -> 0 bytes .../slide-level-0/h1-with-table/moved-layouts.pptx | Bin 41381 -> 0 bytes .../h2-with-image/deleted-layouts.pptx | Bin 47114 -> 0 bytes .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 57800 -> 0 bytes .../deleted-layouts.pptx | Bin 34486 -> 0 bytes .../moved-layouts.pptx | Bin 45176 -> 0 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33507 -> 0 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44195 -> 0 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54374 -> 0 bytes .../speaker-notes-afterseps/moved-layouts.pptx | Bin 65064 -> 0 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38206 -> 0 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 48899 -> 0 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 31502 -> 0 bytes test/pptx/start-numbering-at/moved-layouts.pptx | Bin 42192 -> 0 bytes test/pptx/tables/deleted-layouts.pptx | Bin 32040 -> 0 bytes test/pptx/tables/moved-layouts.pptx | Bin 42729 -> 0 bytes test/pptx/two-column/all-text/deleted-layouts.pptx | Bin 30567 -> 0 bytes test/pptx/two-column/all-text/moved-layouts.pptx | Bin 41255 -> 0 bytes .../two-column/text-and-image/deleted-layouts.pptx | Bin 48381 -> 0 bytes .../two-column/text-and-image/moved-layouts.pptx | Bin 59075 -> 0 bytes 84 files changed, 38 insertions(+), 20 deletions(-) delete mode 100644 test/pptx/background-image/deleted-layouts.pptx delete mode 100644 test/pptx/background-image/moved-layouts.pptx delete mode 100644 test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx delete mode 100644 test/pptx/blanks/just-speaker-notes/moved-layouts.pptx delete mode 100644 test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx delete mode 100644 test/pptx/blanks/nbsp-in-body/moved-layouts.pptx delete mode 100644 test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx delete mode 100644 test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx delete mode 100644 test/pptx/code-custom/deleted-layouts.pptx delete mode 100644 test/pptx/code-custom/moved-layouts.pptx delete mode 100644 test/pptx/code/deleted-layouts.pptx delete mode 100644 test/pptx/code/moved-layouts.pptx delete mode 100644 test/pptx/comparison/both-columns/deleted-layouts.pptx delete mode 100644 test/pptx/comparison/both-columns/moved-layouts.pptx delete mode 100644 test/pptx/comparison/extra-image/deleted-layouts.pptx delete mode 100644 test/pptx/comparison/extra-image/moved-layouts.pptx delete mode 100644 test/pptx/comparison/extra-text/deleted-layouts.pptx delete mode 100644 test/pptx/comparison/extra-text/moved-layouts.pptx delete mode 100644 test/pptx/comparison/non-text-first/deleted-layouts.pptx delete mode 100644 test/pptx/comparison/non-text-first/moved-layouts.pptx delete mode 100644 test/pptx/comparison/one-column/deleted-layouts.pptx delete mode 100644 test/pptx/comparison/one-column/moved-layouts.pptx delete mode 100644 test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx delete mode 100644 test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx delete mode 100644 test/pptx/content-with-caption/image-text/deleted-layouts.pptx delete mode 100644 test/pptx/content-with-caption/image-text/moved-layouts.pptx delete mode 100644 test/pptx/content-with-caption/text-image/deleted-layouts.pptx delete mode 100644 test/pptx/content-with-caption/text-image/moved-layouts.pptx delete mode 100644 test/pptx/document-properties-short-desc/deleted-layouts.pptx delete mode 100644 test/pptx/document-properties-short-desc/moved-layouts.pptx delete mode 100644 test/pptx/document-properties/deleted-layouts.pptx delete mode 100644 test/pptx/document-properties/moved-layouts.pptx delete mode 100644 test/pptx/endnotes-toc/deleted-layouts.pptx delete mode 100644 test/pptx/endnotes-toc/moved-layouts.pptx delete mode 100644 test/pptx/endnotes/deleted-layouts.pptx delete mode 100644 test/pptx/endnotes/moved-layouts.pptx delete mode 100644 test/pptx/images/deleted-layouts.pptx delete mode 100644 test/pptx/images/moved-layouts.pptx delete mode 100644 test/pptx/incremental-lists/with-flag/deleted-layouts.pptx delete mode 100644 test/pptx/incremental-lists/with-flag/moved-layouts.pptx delete mode 100644 test/pptx/incremental-lists/without-flag/deleted-layouts.pptx delete mode 100644 test/pptx/incremental-lists/without-flag/moved-layouts.pptx delete mode 100644 test/pptx/inline-formatting/deleted-layouts.pptx delete mode 100644 test/pptx/inline-formatting/moved-layouts.pptx create mode 100644 test/pptx/layouts/deleted.pptx create mode 100644 test/pptx/layouts/input.native create mode 100644 test/pptx/layouts/moved.pptx delete mode 100644 test/pptx/lists/deleted-layouts.pptx delete mode 100644 test/pptx/lists/moved-layouts.pptx delete mode 100644 test/pptx/raw-ooxml/deleted-layouts.pptx delete mode 100644 test/pptx/raw-ooxml/moved-layouts.pptx delete mode 100644 test/pptx/remove-empty-slides/deleted-layouts.pptx delete mode 100644 test/pptx/remove-empty-slides/moved-layouts.pptx delete mode 100644 test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx delete mode 100644 test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx delete mode 100644 test/pptx/slide-breaks-toc/deleted-layouts.pptx delete mode 100644 test/pptx/slide-breaks-toc/moved-layouts.pptx delete mode 100644 test/pptx/slide-breaks/deleted-layouts.pptx delete mode 100644 test/pptx/slide-breaks/moved-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx delete mode 100644 test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx delete mode 100644 test/pptx/speaker-notes-after-metadata/moved-layouts.pptx delete mode 100644 test/pptx/speaker-notes-afterheader/deleted-layouts.pptx delete mode 100644 test/pptx/speaker-notes-afterheader/moved-layouts.pptx delete mode 100644 test/pptx/speaker-notes-afterseps/deleted-layouts.pptx delete mode 100644 test/pptx/speaker-notes-afterseps/moved-layouts.pptx delete mode 100644 test/pptx/speaker-notes/deleted-layouts.pptx delete mode 100644 test/pptx/speaker-notes/moved-layouts.pptx delete mode 100644 test/pptx/start-numbering-at/deleted-layouts.pptx delete mode 100644 test/pptx/start-numbering-at/moved-layouts.pptx delete mode 100644 test/pptx/tables/deleted-layouts.pptx delete mode 100644 test/pptx/tables/moved-layouts.pptx delete mode 100644 test/pptx/two-column/all-text/deleted-layouts.pptx delete mode 100644 test/pptx/two-column/all-text/moved-layouts.pptx delete mode 100644 test/pptx/two-column/text-and-image/deleted-layouts.pptx delete mode 100644 test/pptx/two-column/text-and-image/moved-layouts.pptx (limited to 'test/pptx') diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index b2df80e5f..84bdd7476 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -7,7 +7,6 @@ import System.FilePath import Text.DocTemplates (ToContext(toVal), Context(..)) import qualified Data.Map as M import Data.Text (pack) -import Data.List (unzip4) -- templating is important enough, and can break enough things, that -- we want to run all our tests with both default formatting and a @@ -17,11 +16,9 @@ modifyPptxName :: FilePath -> String -> FilePath modifyPptxName fp suffix = addExtension (takeDirectory fp ++ suffix) "pptx" -pptxTests :: String -> WriterOptions -> FilePath -> FilePath -> (TestTree, TestTree, TestTree, TestTree) +pptxTests :: String -> WriterOptions -> FilePath -> FilePath -> (TestTree, TestTree) pptxTests name opts native pptx = let referenceDoc = "pptx/reference-depth.pptx" - movedLayoutsReferenceDoc = "pptx/reference-moved-layouts.pptx" - deletedLayoutsReferenceDoc = "pptx/reference-deleted-layouts.pptx" in ( ooxmlTest writePowerpoint @@ -35,28 +32,14 @@ pptxTests name opts native pptx = opts{writerReferenceDoc=Just referenceDoc} native (modifyPptxName pptx "/templated") - , ooxmlTest - writePowerpoint - name - opts{writerReferenceDoc=Just movedLayoutsReferenceDoc} - native - (modifyPptxName pptx "/moved-layouts") - , ooxmlTest - writePowerpoint - name - opts{writerReferenceDoc=Just deletedLayoutsReferenceDoc} - native - (modifyPptxName pptx "/deleted-layouts") ) -groupPptxTests :: [(TestTree, TestTree, TestTree, TestTree)] -> [TestTree] +groupPptxTests :: [(TestTree, TestTree)] -> [TestTree] groupPptxTests pairs = - let (noRefs, refs, movedLayouts, deletedLayouts) = unzip4 pairs + let (noRefs, refs) = unzip pairs in [ testGroup "Default slide formatting" noRefs , testGroup "With `--reference-doc` pptx file" refs - , testGroup "With layouts in reference doc moved" movedLayouts - , testGroup "With layouts in reference doc deleted" deletedLayouts ] @@ -272,5 +255,17 @@ tests = let def { writerReferenceDoc = Just "pptx/footer/higher-slide-number/reference.pptx"} "pptx/footer/input.native" "pptx/footer/higher-slide-number/output.pptx" + , ooxmlTest + writePowerpoint + "Layouts can be moved around in reference doc" + def {writerReferenceDoc = Just "pptx/reference-moved-layouts.pptx"} + "pptx/layouts/input.native" + "pptx/layouts/moved.pptx" + , ooxmlTest + writePowerpoint + "Layouts can be missing from the reference doc" + def {writerReferenceDoc = Just "pptx/reference-deleted-layouts.pptx"} + "pptx/layouts/input.native" + "pptx/layouts/deleted.pptx" ] in regularTests <> referenceSpecificTests diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx deleted file mode 100644 index e46a58ad7..000000000 Binary files a/test/pptx/background-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx deleted file mode 100644 index 98fe33095..000000000 Binary files a/test/pptx/background-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx deleted file mode 100644 index f729c3ce6..000000000 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx deleted file mode 100644 index dfae6a645..000000000 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx deleted file mode 100644 index dcd88cb24..000000000 Binary files a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx deleted file mode 100644 index 0a69853fa..000000000 Binary files a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx deleted file mode 100644 index dcd88cb24..000000000 Binary files a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx deleted file mode 100644 index 0a69853fa..000000000 Binary files a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx deleted file mode 100644 index f8b1c789e..000000000 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx deleted file mode 100644 index 810b46dd1..000000000 Binary files a/test/pptx/code-custom/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx deleted file mode 100644 index 3127e20e5..000000000 Binary files a/test/pptx/code/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx deleted file mode 100644 index 7a2e3b7ac..000000000 Binary files a/test/pptx/code/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx deleted file mode 100644 index 6d80e275f..000000000 Binary files a/test/pptx/comparison/both-columns/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx deleted file mode 100644 index 2840e0535..000000000 Binary files a/test/pptx/comparison/both-columns/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx deleted file mode 100644 index 771ad409a..000000000 Binary files a/test/pptx/comparison/extra-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx deleted file mode 100644 index 2418e98c1..000000000 Binary files a/test/pptx/comparison/extra-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx deleted file mode 100644 index c87b3f3ee..000000000 Binary files a/test/pptx/comparison/extra-text/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx deleted file mode 100644 index 2840e0535..000000000 Binary files a/test/pptx/comparison/extra-text/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx deleted file mode 100644 index 95b2e3a3c..000000000 Binary files a/test/pptx/comparison/non-text-first/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx deleted file mode 100644 index 5a60028d4..000000000 Binary files a/test/pptx/comparison/non-text-first/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx deleted file mode 100644 index 6a705c735..000000000 Binary files a/test/pptx/comparison/one-column/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx deleted file mode 100644 index f456151a5..000000000 Binary files a/test/pptx/comparison/one-column/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx deleted file mode 100644 index d01a8f9d8..000000000 Binary files a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx deleted file mode 100644 index 69cb830a9..000000000 Binary files a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx deleted file mode 100644 index e9aebd579..000000000 Binary files a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx deleted file mode 100644 index c27f1e1cf..000000000 Binary files a/test/pptx/content-with-caption/image-text/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx deleted file mode 100644 index f15e674c7..000000000 Binary files a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx deleted file mode 100644 index 39566cd7f..000000000 Binary files a/test/pptx/content-with-caption/text-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx deleted file mode 100644 index a6da0c338..000000000 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx deleted file mode 100644 index 4cff1d486..000000000 Binary files a/test/pptx/document-properties-short-desc/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx deleted file mode 100644 index a2a58af34..000000000 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx deleted file mode 100644 index e24d904a2..000000000 Binary files a/test/pptx/document-properties/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes-toc/deleted-layouts.pptx b/test/pptx/endnotes-toc/deleted-layouts.pptx deleted file mode 100644 index 3e613e038..000000000 Binary files a/test/pptx/endnotes-toc/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes-toc/moved-layouts.pptx b/test/pptx/endnotes-toc/moved-layouts.pptx deleted file mode 100644 index e64cd9c77..000000000 Binary files a/test/pptx/endnotes-toc/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes/deleted-layouts.pptx b/test/pptx/endnotes/deleted-layouts.pptx deleted file mode 100644 index 1d7ccb928..000000000 Binary files a/test/pptx/endnotes/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes/moved-layouts.pptx b/test/pptx/endnotes/moved-layouts.pptx deleted file mode 100644 index 0f071207c..000000000 Binary files a/test/pptx/endnotes/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx deleted file mode 100644 index 3c3ed787f..000000000 Binary files a/test/pptx/images/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx deleted file mode 100644 index b22f3652a..000000000 Binary files a/test/pptx/images/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx deleted file mode 100644 index 3e92d4dab..000000000 Binary files a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx deleted file mode 100644 index 050842865..000000000 Binary files a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx deleted file mode 100644 index 4816c0b39..000000000 Binary files a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx deleted file mode 100644 index 4f27db07b..000000000 Binary files a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/inline-formatting/deleted-layouts.pptx b/test/pptx/inline-formatting/deleted-layouts.pptx deleted file mode 100644 index ac9fa4725..000000000 Binary files a/test/pptx/inline-formatting/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/inline-formatting/moved-layouts.pptx b/test/pptx/inline-formatting/moved-layouts.pptx deleted file mode 100644 index 49a2409d1..000000000 Binary files a/test/pptx/inline-formatting/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/layouts/deleted.pptx b/test/pptx/layouts/deleted.pptx new file mode 100644 index 000000000..f7116b2f4 Binary files /dev/null and b/test/pptx/layouts/deleted.pptx differ diff --git a/test/pptx/layouts/input.native b/test/pptx/layouts/input.native new file mode 100644 index 000000000..0cee2d14e --- /dev/null +++ b/test/pptx/layouts/input.native @@ -0,0 +1,23 @@ +Pandoc (Meta {unMeta = fromList [("title",MetaInlines [Str "Testing",Space,Str "Layouts"])]}) +[Header 2 ("slide-1",[],[]) [Str "Slide",Space,Str "1"] +,Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "title",Space,Str "and",Space,Str "content",Space,Str "slide"] +,Header 2 ("slide-2",[],[]) [Str "Slide",Space,Str "2"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "This"]] + ,Div ("",["column"],[]) + [Para [Str "\8230is",Space,Str "a",Space,Str "two-column",Space,Str "slide"]]] +,Header 2 ("slide-3",[],[]) [Str "Slide",Space,Str "3"] +,Para [Str "This",Space,Str "slide",Space,Str "is",Space,Str "a",Space,Str "Content",Space,Str "with",Space,Str "Caption",Space,Str "slide"] +,Para [Image ("",[],[]) [Str "Content"] ("lalune.jpg","fig:")] +,Header 2 ("slide-4",[],[]) [Str "Slide",Space,Str "4"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "This",Space,Str "slide",Space,Str "is",Space,Str "a",Space,Str "Comparison",Space,Str "slide:"] + ,Para [Image ("",[],[]) [Str "Content"] ("lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "other",Space,Str "text"]]] +,Header 1 ("section-header",[],[]) [Str "Section",Space,Str "header"] +,Header 2 ("section",[],[]) [] +,Div ("",["notes"],[]) + [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "blank",Space,Str "slide"]]] diff --git a/test/pptx/layouts/moved.pptx b/test/pptx/layouts/moved.pptx new file mode 100644 index 000000000..e41465a86 Binary files /dev/null and b/test/pptx/layouts/moved.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx deleted file mode 100644 index d064b7fd5..000000000 Binary files a/test/pptx/lists/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx deleted file mode 100644 index 8a9c9ec59..000000000 Binary files a/test/pptx/lists/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/raw-ooxml/deleted-layouts.pptx b/test/pptx/raw-ooxml/deleted-layouts.pptx deleted file mode 100644 index a7bd12281..000000000 Binary files a/test/pptx/raw-ooxml/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/raw-ooxml/moved-layouts.pptx b/test/pptx/raw-ooxml/moved-layouts.pptx deleted file mode 100644 index 614682671..000000000 Binary files a/test/pptx/raw-ooxml/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/remove-empty-slides/deleted-layouts.pptx b/test/pptx/remove-empty-slides/deleted-layouts.pptx deleted file mode 100644 index 488abc02a..000000000 Binary files a/test/pptx/remove-empty-slides/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/remove-empty-slides/moved-layouts.pptx b/test/pptx/remove-empty-slides/moved-layouts.pptx deleted file mode 100644 index 1e1cf1e44..000000000 Binary files a/test/pptx/remove-empty-slides/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx deleted file mode 100644 index b6b004cd6..000000000 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx deleted file mode 100644 index 229e4c32a..000000000 Binary files a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx deleted file mode 100644 index e3b3b2807..000000000 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx deleted file mode 100644 index ecc942803..000000000 Binary files a/test/pptx/slide-breaks-toc/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx deleted file mode 100644 index ada3453b0..000000000 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx deleted file mode 100644 index 0fe10f443..000000000 Binary files a/test/pptx/slide-breaks/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx deleted file mode 100644 index c315a7a7a..000000000 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx deleted file mode 100644 index 81b49936d..000000000 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx deleted file mode 100644 index 478dde788..000000000 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx deleted file mode 100644 index 63b411888..000000000 Binary files a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx deleted file mode 100644 index 9d58c2c52..000000000 Binary files a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx deleted file mode 100644 index 62424de73..000000000 Binary files a/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx deleted file mode 100644 index 478dde788..000000000 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx deleted file mode 100644 index 63b411888..000000000 Binary files a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx deleted file mode 100644 index 07e21ef02..000000000 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx deleted file mode 100644 index d6673aac0..000000000 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx deleted file mode 100644 index 0ccdd72b7..000000000 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx deleted file mode 100644 index 81f0a56cb..000000000 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx deleted file mode 100644 index 33dedf2c3..000000000 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx deleted file mode 100644 index 28bcf3887..000000000 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx deleted file mode 100644 index 5f407086a..000000000 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx deleted file mode 100644 index 83d5ed0af..000000000 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx deleted file mode 100644 index d99fedfa6..000000000 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx deleted file mode 100644 index 98db3ec74..000000000 Binary files a/test/pptx/start-numbering-at/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx deleted file mode 100644 index 7ad714058..000000000 Binary files a/test/pptx/tables/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx deleted file mode 100644 index 9628717d7..000000000 Binary files a/test/pptx/tables/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/all-text/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx deleted file mode 100644 index a321128b5..000000000 Binary files a/test/pptx/two-column/all-text/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/all-text/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx deleted file mode 100644 index 90b1d9254..000000000 Binary files a/test/pptx/two-column/all-text/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx deleted file mode 100644 index 46274ffac..000000000 Binary files a/test/pptx/two-column/text-and-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx deleted file mode 100644 index c25331e23..000000000 Binary files a/test/pptx/two-column/text-and-image/moved-layouts.pptx and /dev/null differ -- cgit v1.2.3 From 8af15ab345bb0790cc3442722673d9da9f23a79c Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Fri, 17 Sep 2021 16:05:06 +0100 Subject: pptx: Fix list level numbering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In PowerPoint, the content of a top-level list is at the same level as the content of a top-level paragraph – the only difference is that a list style has been applied. At the moment, the pptx writer increments the paragraph level on each list, turning what should be top-level lists into second-level lists. This commit changes that logic, only incrementing the paragraph level on continuation paragraphs of lists. - Fixes https://github.com/jgm/pandoc/issues/4828 - Fixes https://github.com/jgm/pandoc/issues/4663 --- pandoc.cabal | 2 ++ src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 31 +++++++++++---------- test/Tests/Writers/Powerpoint.hs | 4 +++ test/pptx/code-custom/output.pptx | Bin 29817 -> 29807 bytes test/pptx/code-custom/templated.pptx | Bin 42884 -> 42877 bytes test/pptx/code/output.pptx | Bin 29815 -> 29806 bytes test/pptx/code/templated.pptx | Bin 42882 -> 42876 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77169 -> 77136 bytes .../incremental-lists/with-flag/templated.pptx | Bin 90280 -> 90251 bytes .../incremental-lists/without-flag/output.pptx | Bin 75411 -> 75386 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88518 -> 88495 bytes test/pptx/list-level/input.native | 20 +++++++++++++ test/pptx/list-level/output.pptx | Bin 0 -> 28635 bytes test/pptx/list-level/templated.pptx | Bin 0 -> 41701 bytes test/pptx/lists/output.pptx | Bin 28664 -> 28657 bytes test/pptx/lists/templated.pptx | Bin 41729 -> 41724 bytes test/pptx/pauses/without-incremental/output.pptx | Bin 0 -> 50083 bytes .../pptx/pauses/without-incremental/templated.pptx | Bin 0 -> 63157 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31129 -> 31123 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 44195 -> 44191 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51494 -> 51486 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64558 -> 64552 bytes test/pptx/start-numbering-at/output.pptx | Bin 28626 -> 28620 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41691 -> 41686 bytes 24 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 test/pptx/list-level/input.native create mode 100644 test/pptx/list-level/output.pptx create mode 100644 test/pptx/list-level/templated.pptx create mode 100644 test/pptx/pauses/without-incremental/output.pptx create mode 100644 test/pptx/pauses/without-incremental/templated.pptx (limited to 'test/pptx') diff --git a/pandoc.cabal b/pandoc.cabal index 615feaccb..ac6cb8121 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -429,6 +429,8 @@ extra-source-files: test/pptx/inline-formatting/*.pptx test/pptx/lists/input.native test/pptx/lists/*.pptx + test/pptx/list-level/input.native + test/pptx/list-level/*.pptx test/pptx/raw-ooxml/input.native test/pptx/raw-ooxml/*.pptx test/pptx/remove-empty-slides/input.native diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index fe34d24dc..2f94dcc17 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -500,27 +500,23 @@ blockToParagraphs (Header _ (ident, _, _) ils) = do blockToParagraphs (BulletList blksLst) = do pProps <- asks envParaProps incremental <- listShouldBeIncremental - let lvl = pPropLevel pProps local (\env -> env{ envInList = True - , envParaProps = pProps{ pPropLevel = lvl + 1 - , pPropBullet = Just Bullet + , envParaProps = pProps{ pPropBullet = Just Bullet , pPropMarginLeft = Nothing , pPropIndent = Nothing , pPropIncremental = incremental }}) $ - concatMapM multiParBullet blksLst + concatMapM multiParList blksLst blockToParagraphs (OrderedList listAttr blksLst) = do pProps <- asks envParaProps incremental <- listShouldBeIncremental - let lvl = pPropLevel pProps local (\env -> env{ envInList = True - , envParaProps = pProps{ pPropLevel = lvl + 1 - , pPropBullet = Just (AutoNumbering listAttr) + , envParaProps = pProps{ pPropBullet = Just (AutoNumbering listAttr) , pPropMarginLeft = Nothing , pPropIndent = Nothing , pPropIncremental = incremental }}) $ - concatMapM multiParBullet blksLst + concatMapM multiParList blksLst blockToParagraphs (DefinitionList entries) = do incremental <- listShouldBeIncremental let go :: ([Inline], [[Block]]) -> Pres [Paragraph] @@ -545,14 +541,21 @@ blockToParagraphs blk = do addLogMessage $ BlockNotRendered blk return [] --- Make sure the bullet env gets turned off after the first para. -multiParBullet :: [Block] -> Pres [Paragraph] -multiParBullet [] = return [] -multiParBullet (b:bs) = do +-- | Make sure the bullet env gets turned off after the first paragraph, and +-- indent any continuation paragraphs. +multiParList :: [Block] -> Pres [Paragraph] +multiParList [] = return [] +multiParList (b:bs) = do pProps <- asks envParaProps p <- blockToParagraphs b - ps <- local (\env -> env{envParaProps = pProps{pPropBullet = Nothing}}) $ - concatMapM blockToParagraphs bs + let level = pPropLevel pProps + ps <- local (\env -> env + { envParaProps = pProps + { pPropBullet = Nothing + , pPropLevel = level + 1 + } + }) + $ concatMapM blockToParagraphs bs return $ p ++ ps cellToParagraphs :: Alignment -> SimpleCell -> Pres [Paragraph] diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 84bdd7476..f3663efbb 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -66,6 +66,10 @@ tests = let def "pptx/start-numbering-at/input.native" "pptx/start-numbering-at/output.pptx" + , pptxTests "List continuation paragraph indentation" + def + "pptx/list-level/input.native" + "pptx/list-level/output.pptx" , pptxTests "tables" def "pptx/tables/input.native" diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index ded8f1125..6c7a1a9ab 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 8bb0df1ff..116865c1f 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index e700bc268..8fd00ff74 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index 44f34cd64..0d7db048f 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index 1ca1dbf17..82f5f926f 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index 4ddf6bb75..e8482b25f 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 6f7261ba3..62e66e1fe 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index ca5c9fdab..ac7be9564 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/list-level/input.native b/test/pptx/list-level/input.native new file mode 100644 index 000000000..e0b36b8e5 --- /dev/null +++ b/test/pptx/list-level/input.native @@ -0,0 +1,20 @@ +[Header 1 ("slide",[],[]) [Str "Slide"] +,BulletList + [[Para [Str "Top-level"] + ,Para [Str "With",Space,Str "continuation",Space,Str "paragraph"]] + ,[Para [Str "Then:"] + ,BulletList + [[Plain [Str "nested"]] + ,[Plain [Str "list"]] + ,[Plain [Str "items"]]]]] +,Header 1 ("slide-1",[],[]) [Str "Slide"] +,Para [Str "Paragraph."] +,OrderedList (1,Decimal,Period) + [[Para [Str "Top-level"] + ,Para [Str "Continuation"] + ,OrderedList (1,Decimal,Period) + [[Para [Str "Sub-list"] + ,Para [Str "With",Space,Str "Continuation"]] + ,[Para [Str "(still",Space,Str "sub-list)"]]]] + ,[Para [Str "(back",Space,Str "to",Space,Str "top-level)"]]] +,Para [Str "Paragraph."]] diff --git a/test/pptx/list-level/output.pptx b/test/pptx/list-level/output.pptx new file mode 100644 index 000000000..5e3506958 Binary files /dev/null and b/test/pptx/list-level/output.pptx differ diff --git a/test/pptx/list-level/templated.pptx b/test/pptx/list-level/templated.pptx new file mode 100644 index 000000000..8853a3082 Binary files /dev/null and b/test/pptx/list-level/templated.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index 94a424f42..e23f47218 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 52097489f..290b5b519 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/pauses/without-incremental/output.pptx b/test/pptx/pauses/without-incremental/output.pptx new file mode 100644 index 000000000..9085db330 Binary files /dev/null and b/test/pptx/pauses/without-incremental/output.pptx differ diff --git a/test/pptx/pauses/without-incremental/templated.pptx b/test/pptx/pauses/without-incremental/templated.pptx new file mode 100644 index 000000000..6662e2451 Binary files /dev/null and b/test/pptx/pauses/without-incremental/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index 788cdf148..f2660ef93 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index d11744079..0a2bdb857 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 99110d3ca..b54ba4465 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index daf8e2175..3b272ab1b 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index bc74ec599..ecfc6901a 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index 4f191a06e..f3f46ef30 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ -- cgit v1.2.3 From 8de261ba4e1e03f9dd5f78297d7299e9d78bbcfd Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 23 Sep 2021 16:01:38 +0100 Subject: pptx: Line up continuation paragraphs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit changes the `marL` and `indent` values used for plain paragraphs and numbered lists, and changes the spacing defined in the reference doc master for bulleted lists. For paragraphs, there is now a left-indent taken from the `otherStyle` in the master. For numbered lists, the number is positioned where the text would be if this were a plain paragraph, and the text is indented to the next level. This means that continuation paragraphs line up nicely with numbered lists. It also /mostly/ matches the observed PowerPoint behaviour when inserting paragraphs and numbered lists: the only difference is that PowerPoint was using a different margin value for the first level numbered lists – I’ve changed this to match the other levels, as I don’t think it makes the spacing unappealing and it allows continuation paragraphs at any level to line up. With bulleted lists, I’m keeping the observed PowerPoint behaviour of specifying only a level, letting `marL` and `indent` be automatically taken from `bodyStyle`. To that end, this commit changes the `bodyStyle` spacing in the master of the default reference doc, to: - line up the text of the first paragraph in each bullet with any continuation paragraphs - line up nested bullet markers in any continuation paragraphs with the first paragraph, matching lists and plain paragraphs This does mean the continuation paragraphs still won’t line up for anyone using their own reference doc where they haven’t matched the `otherStyle` and `bodyStyle` indent levels, but I think people in that situation will be able to troubleshoot. --- data/pptx/ppt/slideMasters/slideMaster1.xml | 2 +- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 100 +++++++++++++++++++-- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 3 +- test/pptx/background-image/output.pptx | Bin 53358 -> 53318 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32267 -> 32227 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 29205 -> 29165 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 29205 -> 29165 bytes test/pptx/code-custom/output.pptx | Bin 29807 -> 29776 bytes test/pptx/code/output.pptx | Bin 29806 -> 29773 bytes test/pptx/comparison/both-columns/output.pptx | Bin 44570 -> 44530 bytes test/pptx/comparison/extra-image/output.pptx | Bin 44599 -> 44559 bytes test/pptx/comparison/extra-text/output.pptx | Bin 44570 -> 44530 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 44484 -> 44444 bytes test/pptx/comparison/one-column/output.pptx | Bin 27902 -> 27862 bytes .../heading-text-image/output.pptx | Bin 44318 -> 44278 bytes .../content-with-caption/image-text/output.pptx | Bin 45019 -> 44979 bytes .../content-with-caption/text-image/output.pptx | Bin 44258 -> 44218 bytes .../document-properties-short-desc/output.pptx | Bin 28613 -> 28573 bytes test/pptx/document-properties/output.pptx | Bin 29015 -> 28976 bytes test/pptx/endnotes-toc/output.pptx | Bin 29399 -> 29363 bytes test/pptx/endnotes/output.pptx | Bin 28580 -> 28544 bytes test/pptx/images/output.pptx | Bin 46235 -> 46195 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77136 -> 77125 bytes .../incremental-lists/with-flag/templated.pptx | Bin 90251 -> 90277 bytes .../incremental-lists/without-flag/output.pptx | Bin 75386 -> 75374 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88495 -> 88522 bytes test/pptx/inline-formatting/output.pptx | Bin 27772 -> 27736 bytes test/pptx/list-level/output.pptx | Bin 28635 -> 28632 bytes test/pptx/list-level/templated.pptx | Bin 41701 -> 41735 bytes test/pptx/lists/output.pptx | Bin 28657 -> 28639 bytes test/pptx/lists/templated.pptx | Bin 41724 -> 41742 bytes test/pptx/raw-ooxml/output.pptx | Bin 28560 -> 28524 bytes test/pptx/remove-empty-slides/output.pptx | Bin 44994 -> 44958 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 29354 -> 29314 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31123 -> 31087 bytes test/pptx/slide-breaks/output.pptx | Bin 30179 -> 30139 bytes .../slide-level-0/h1-h2-with-table/output.pptx | Bin 27907 -> 27871 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 44242 -> 44202 bytes test/pptx/slide-level-0/h1-with-table/output.pptx | Bin 27814 -> 27778 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 44242 -> 44202 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31617 -> 31577 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30629 -> 30589 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51486 -> 51450 bytes test/pptx/speaker-notes/output.pptx | Bin 35329 -> 35289 bytes test/pptx/start-numbering-at/output.pptx | Bin 28620 -> 28605 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41686 -> 41707 bytes test/pptx/tables/output.pptx | Bin 29160 -> 29122 bytes test/pptx/two-column/all-text/output.pptx | Bin 27689 -> 27649 bytes test/pptx/two-column/text-and-image/output.pptx | Bin 45510 -> 45470 bytes 49 files changed, 94 insertions(+), 11 deletions(-) (limited to 'test/pptx') diff --git a/data/pptx/ppt/slideMasters/slideMaster1.xml b/data/pptx/ppt/slideMasters/slideMaster1.xml index 69f0af019..2e0425358 100644 --- a/data/pptx/ppt/slideMasters/slideMaster1.xml +++ b/data/pptx/ppt/slideMasters/slideMaster1.xml @@ -1,2 +1,2 @@ -Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level4/5/2019‹#› \ No newline at end of file +Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level4/5/2019‹#› diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 487dcad2e..e799297de 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -126,6 +126,7 @@ data WriterEnv = WriterEnv { envRefArchive :: Archive , envSpeakerNotesIdMap :: M.Map Int Int , envInSpeakerNotes :: Bool , envSlideLayouts :: Maybe SlideLayouts + , envOtherStyleIndents :: Maybe Indents } deriving (Show) @@ -145,6 +146,7 @@ instance Default WriterEnv where , envSpeakerNotesIdMap = mempty , envInSpeakerNotes = False , envSlideLayouts = Nothing + , envOtherStyleIndents = Nothing } type SlideLayouts = SlideLayoutsOf SlideLayout @@ -183,6 +185,39 @@ data Placeholder = Placeholder , index :: Int } deriving (Show, Eq) +-- | Paragraph indentation info. +data Indents = Indents + { level1 :: Maybe LevelIndents + , level2 :: Maybe LevelIndents + , level3 :: Maybe LevelIndents + , level4 :: Maybe LevelIndents + , level5 :: Maybe LevelIndents + , level6 :: Maybe LevelIndents + , level7 :: Maybe LevelIndents + , level8 :: Maybe LevelIndents + , level9 :: Maybe LevelIndents + } deriving (Show, Eq) + +levelIndent :: Indents -> Int -> Maybe LevelIndents +levelIndent is index = getter is + where + getter = case index of + 0 -> level1 + 1 -> level2 + 2 -> level3 + 3 -> level4 + 4 -> level5 + 5 -> level6 + 6 -> level7 + 7 -> level8 + 8 -> level9 + _ -> const Nothing + +data LevelIndents = LevelIndents + { marL :: EMU + , indent :: EMU + } deriving (Show, Eq) + data MediaInfo = MediaInfo { mInfoFilePath :: FilePath , mInfoLocalId :: Int , mInfoGlobalId :: Int @@ -580,6 +615,33 @@ presentationToArchive opts meta pres = do , slInReferenceDoc = True } + master <- getMaster' refArchive distArchive + + let otherStyleIndents = do + let ns = elemToNameSpaces master + txStyles <- findChild (elemName ns "p" "txStyles") master + otherStyle <- findChild (elemName ns "p" "otherStyle") txStyles + let makeLevelIndents name = do + e <- findChild (elemName ns "a" name) otherStyle + pure LevelIndents + { indent = fromMaybe (-342900) + (findAttr (QName "indent" Nothing Nothing) e + >>= readTextAsInteger) + , marL = fromMaybe 347663 + (findAttr (QName "marL" Nothing Nothing) e + >>= readTextAsInteger) + } + pure Indents + { level1 = makeLevelIndents "lvl1pPr" + , level2 = makeLevelIndents "lvl2pPr" + , level3 = makeLevelIndents "lvl3pPr" + , level4 = makeLevelIndents "lvl4pPr" + , level5 = makeLevelIndents "lvl5pPr" + , level6 = makeLevelIndents "lvl6pPr" + , level7 = makeLevelIndents "lvl7pPr" + , level8 = makeLevelIndents "lvl8pPr" + , level9 = makeLevelIndents "lvl9pPr" + } utctime <- P.getTimestamp @@ -605,6 +667,7 @@ presentationToArchive opts meta pres = do , envSlideIdMap = makeSlideIdMap pres , envSpeakerNotesIdMap = makeSpeakerNotesMap pres , envSlideLayouts = Just layouts + , envOtherStyleIndents = otherStyleIndents } let st = def { stMediaGlobalIds = initialGlobalIds refArchive distArchive @@ -910,6 +973,10 @@ getMaster :: PandocMonad m => P m Element getMaster = do refArchive <- asks envRefArchive distArchive <- asks envDistArchive + getMaster' refArchive distArchive + +getMaster' :: PandocMonad m => Archive -> Archive -> m Element +getMaster' refArchive distArchive = parseXml refArchive distArchive "ppt/slideMasters/slideMaster1.xml" getMasterRels :: PandocMonad m => P m Element @@ -1196,15 +1263,32 @@ surroundWithMathAlternate element = paragraphToElement :: PandocMonad m => Paragraph -> P m Element paragraphToElement par = do + indents <- asks envOtherStyleIndents let - attrs = [("lvl", tshow $ pPropLevel $ paraProps par)] <> - (case pPropMarginLeft (paraProps par) of - Just px -> [("marL", tshow $ pixelsToEmu px)] - Nothing -> [] - ) <> - (case pPropIndent (paraProps par) of - Just px -> [("indent", tshow $ pixelsToEmu px)] - Nothing -> [] + lvl = pPropLevel (paraProps par) + attrs = [("lvl", tshow lvl)] <> + (case (pPropIndent (paraProps par), pPropMarginLeft (paraProps par)) of + (Just px1, Just px2) -> [ ("indent", tshow $ pixelsToEmu px1) + , ("marL", tshow $ pixelsToEmu px2) + ] + (Just px1, Nothing) -> [("indent", tshow $ pixelsToEmu px1)] + (Nothing, Just px2) -> [("marL", tshow $ pixelsToEmu px2)] + (Nothing, Nothing) -> fromMaybe [] $ do + indents' <- indents + thisLevel <- levelIndent indents' lvl + nextLevel <- levelIndent indents' (lvl + 1) + let (m, i) = + case pPropBullet (paraProps par) of + Nothing -> + (Just (marL thisLevel), Just 0) + Just (AutoNumbering _) -> + ( Just (marL nextLevel) + , Just (marL thisLevel - marL nextLevel) + ) + Just Bullet -> (Nothing, Nothing) + pure ( toList ((,) "indent" . tshow <$> i) + <> toList ((,) "marL" . tshow <$> m) + ) ) <> (case pPropAlign (paraProps par) of Just AlgnLeft -> [("algn", "l")] diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 2f94dcc17..fd6b83120 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -541,8 +541,7 @@ blockToParagraphs blk = do addLogMessage $ BlockNotRendered blk return [] --- | Make sure the bullet env gets turned off after the first paragraph, and --- indent any continuation paragraphs. +-- | Make sure the bullet env gets turned off after the first para. multiParList :: [Block] -> Pres [Paragraph] multiParList [] = return [] multiParList (b:bs) = do diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx index abe82ebc2..1e678e0a4 100644 Binary files a/test/pptx/background-image/output.pptx and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 0c4ed20fa..9a36ccf1f 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx index 6265c842f..08c764feb 100644 Binary files a/test/pptx/blanks/nbsp-in-body/output.pptx and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx index 6265c842f..08c764feb 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/output.pptx and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index 6c7a1a9ab..1e5085e9c 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index 8fd00ff74..a3f31dfdc 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx index 47f807754..efb67f2e7 100644 Binary files a/test/pptx/comparison/both-columns/output.pptx and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx index f700e09a8..e26e5b49c 100644 Binary files a/test/pptx/comparison/extra-image/output.pptx and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx index 47f807754..efb67f2e7 100644 Binary files a/test/pptx/comparison/extra-text/output.pptx and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx index c8a2bd0e3..f36c53ddb 100644 Binary files a/test/pptx/comparison/non-text-first/output.pptx and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx index e70dd2326..8d9031ac8 100644 Binary files a/test/pptx/comparison/one-column/output.pptx and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx index 0677879aa..6802b7361 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/output.pptx and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx index f461b6ed3..0bd64e340 100644 Binary files a/test/pptx/content-with-caption/image-text/output.pptx and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx index be376c1ed..a0d8806c0 100644 Binary files a/test/pptx/content-with-caption/text-image/output.pptx and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx index 737ca7e8d..418d158ca 100644 Binary files a/test/pptx/document-properties-short-desc/output.pptx and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx index ef05c01b5..55ca48b5d 100644 Binary files a/test/pptx/document-properties/output.pptx and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/endnotes-toc/output.pptx b/test/pptx/endnotes-toc/output.pptx index bb431f511..a6cc2db24 100644 Binary files a/test/pptx/endnotes-toc/output.pptx and b/test/pptx/endnotes-toc/output.pptx differ diff --git a/test/pptx/endnotes/output.pptx b/test/pptx/endnotes/output.pptx index e4e661804..ea29cbcf8 100644 Binary files a/test/pptx/endnotes/output.pptx and b/test/pptx/endnotes/output.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx index 9b04881f3..098547e87 100644 Binary files a/test/pptx/images/output.pptx and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index 82f5f926f..230d29253 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index e8482b25f..263d9c355 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 62e66e1fe..450cd16ea 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index ac7be9564..e7ab48aa0 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/inline-formatting/output.pptx b/test/pptx/inline-formatting/output.pptx index f1a4a0a36..7744b7d2e 100644 Binary files a/test/pptx/inline-formatting/output.pptx and b/test/pptx/inline-formatting/output.pptx differ diff --git a/test/pptx/list-level/output.pptx b/test/pptx/list-level/output.pptx index 5e3506958..02c609b40 100644 Binary files a/test/pptx/list-level/output.pptx and b/test/pptx/list-level/output.pptx differ diff --git a/test/pptx/list-level/templated.pptx b/test/pptx/list-level/templated.pptx index 8853a3082..a7b23ccf9 100644 Binary files a/test/pptx/list-level/templated.pptx and b/test/pptx/list-level/templated.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index e23f47218..857a3e28c 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 290b5b519..5510a7123 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/raw-ooxml/output.pptx b/test/pptx/raw-ooxml/output.pptx index 841495315..1813bbd28 100644 Binary files a/test/pptx/raw-ooxml/output.pptx and b/test/pptx/raw-ooxml/output.pptx differ diff --git a/test/pptx/remove-empty-slides/output.pptx b/test/pptx/remove-empty-slides/output.pptx index e2871a882..d0d5e824c 100644 Binary files a/test/pptx/remove-empty-slides/output.pptx and b/test/pptx/remove-empty-slides/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx index cb65ab335..d443bc04e 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/output.pptx and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index f2660ef93..e24b45e12 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx index 7c2c7db5e..a5208ecf8 100644 Binary files a/test/pptx/slide-breaks/output.pptx and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx index 3f815d830..bd772d44e 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx index 70fc6aee2..1102f549c 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/output.pptx and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/output.pptx b/test/pptx/slide-level-0/h1-with-table/output.pptx index d30fd88c3..c0bc6b162 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/output.pptx and b/test/pptx/slide-level-0/h1-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx index 70fc6aee2..1102f549c 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/output.pptx and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index f68d6f0ef..4e5635e0c 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index 9df78756b..f59b29f6a 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index b54ba4465..aad79e3dc 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index 6ae003d7a..7b44c50c2 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index ecfc6901a..e08d300e5 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index f3f46ef30..30a097eb8 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx index 4398e35be..407062ca3 100644 Binary files a/test/pptx/tables/output.pptx and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/two-column/all-text/output.pptx b/test/pptx/two-column/all-text/output.pptx index 45f651ceb..8a1dce949 100644 Binary files a/test/pptx/two-column/all-text/output.pptx and b/test/pptx/two-column/all-text/output.pptx differ diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx index aab0b3b59..e45bf3d58 100644 Binary files a/test/pptx/two-column/text-and-image/output.pptx and b/test/pptx/two-column/text-and-image/output.pptx differ -- cgit v1.2.3