diff options
13 files changed, 27 insertions, 8 deletions
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/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx Binary files differindex 1d7bd87d3..1d7bd87d3 100644 --- a/test/pptx/two-column/deleted-layouts.pptx +++ b/test/pptx/two-column/all-text/deleted-layouts.pptx diff --git a/test/pptx/two-column/input.native b/test/pptx/two-column/all-text/input.native index 086f74889..086f74889 100644 --- a/test/pptx/two-column/input.native +++ b/test/pptx/two-column/all-text/input.native diff --git a/test/pptx/two-column/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx Binary files differindex 71760268c..71760268c 100644 --- a/test/pptx/two-column/moved-layouts.pptx +++ b/test/pptx/two-column/all-text/moved-layouts.pptx diff --git a/test/pptx/two-column/output.pptx b/test/pptx/two-column/all-text/output.pptx Binary files differindex 396dc2a74..396dc2a74 100644 --- a/test/pptx/two-column/output.pptx +++ b/test/pptx/two-column/all-text/output.pptx diff --git a/test/pptx/two-column/templated.pptx b/test/pptx/two-column/all-text/templated.pptx Binary files differindex 8901695b1..8901695b1 100644 --- a/test/pptx/two-column/templated.pptx +++ b/test/pptx/two-column/all-text/templated.pptx diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx Binary files differnew file mode 100644 index 000000000..297fd6bad --- /dev/null +++ b/test/pptx/two-column/text-and-image/deleted-layouts.pptx 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 Binary files differnew file mode 100644 index 000000000..c9a6e577e --- /dev/null +++ b/test/pptx/two-column/text-and-image/moved-layouts.pptx diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx Binary files differnew file mode 100644 index 000000000..bfd532ed9 --- /dev/null +++ b/test/pptx/two-column/text-and-image/output.pptx diff --git a/test/pptx/two-column/text-and-image/templated.pptx b/test/pptx/two-column/text-and-image/templated.pptx Binary files differnew file mode 100644 index 000000000..23e6b283f --- /dev/null +++ b/test/pptx/two-column/text-and-image/templated.pptx |