From 6f83099f6ef1891a709147e803352262ef00a9f2 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 9 Feb 2023 21:38:58 +0100 Subject: PPTX writer: fix handling of simple figures This ensures that simple figures are displayed in the same way as before the introduction of a dedicated `Figure` constructor in the AST. Closes: #8565 --- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 577389740..dc1d54637 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -539,7 +539,12 @@ blockToParagraphs (Div (_, classes, _) blks) = let in local addIncremental (concatMapM blockToParagraphs blks) blockToParagraphs (Figure attr capt blks) = blockToParagraphs (Shared.figureDiv attr capt blks) -blockToParagraphs blk = do +blockToParagraphs hr@HorizontalRule = notRendered hr +blockToParagraphs tbl@Table{} = notRendered tbl + +-- | Report that a block cannot be rendered. +notRendered :: Block -> Pres [Paragraph] +notRendered blk = do addLogMessage $ BlockNotRendered blk return [] @@ -594,6 +599,7 @@ blockToShape (Para (il:_)) | Link _ (il':_) target <- il withAttr attr . Pic def{picPropLink = Just $ ExternalTarget target} (T.unpack url) title <$> inlinesToParElems ils +blockToShape (Figure _figattr _caption [b]) = blockToShape b blockToShape (Table _ blkCapt specs thead tbody tfoot) = do let (caption, algn, _, hdrCells, rows) = toLegacyTable blkCapt specs thead tbody tfoot caption' <- inlinesToParElems caption -- cgit v1.2.3