aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2023-02-09 21:38:58 +0100
committerAlbert Krewinkel <[email protected]>2023-02-09 21:45:03 +0100
commit6f83099f6ef1891a709147e803352262ef00a9f2 (patch)
tree413f42afc9f5ab5e3adf7b067a2f55ad0b24de35
parentb95fcb5b67c822f8937e7846017cea350af4ea51 (diff)
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
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint/Presentation.hs8
1 files changed, 7 insertions, 1 deletions
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