diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2017-12-22 05:31:04 -0500 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2017-12-22 05:32:23 -0500 |
commit | 279c254007601de5cb6a44e0d51522748880d732 (patch) | |
tree | 04aa83deff695a5eacb5ca161dd7c99731a8ccc1 /src/Text | |
parent | a848d3e031de78d848d4fda922bbc4c85114aa4f (diff) | |
download | pandoc-279c254007601de5cb6a44e0d51522748880d732.tar.gz |
PowerPoint writer: Treat lists inside BlockQuotes as lists
We don't yet produce incremental lists in PowerPoint, but we should at
least treat lists inside BlockQuotes as lists, for compatibility with
other slide formats.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Powerpoint.hs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Powerpoint.hs b/src/Text/Pandoc/Writers/Powerpoint.hs index 7a453ef1f..d5627f51c 100644 --- a/src/Text/Pandoc/Writers/Powerpoint.hs +++ b/src/Text/Pandoc/Writers/Powerpoint.hs @@ -369,6 +369,12 @@ inlineToParElems (Span _ ils) = concatMapM inlineToParElems ils inlineToParElems (RawInline _ _) = return [] inlineToParElems _ = return [] +isListType :: Block -> Bool +isListType (OrderedList _ _) = True +isListType (BulletList _) = True +isListType (DefinitionList _) = True +isListType _ = False + blockToParagraphs :: PandocMonad m => Block -> P m [Paragraph] blockToParagraphs (Plain ils) = do parElems <- inlinesToParElems ils @@ -386,7 +392,13 @@ blockToParagraphs (LineBlock ilsList) = do blockToParagraphs (CodeBlock attr str) = local (\r -> r{envParaProps = def{pPropMarginLeft = Just 100}}) $ blockToParagraphs $ Para [Code attr str] --- TODO: work out the format +-- We can't yet do incremental lists, but we should render a +-- (BlockQuote List) as a list to maintain compatibility with other +-- formats. +blockToParagraphs (BlockQuote (blk : blks)) | isListType blk = do + ps <- blockToParagraphs blk + ps' <- blockToParagraphs $ BlockQuote blks + return $ ps ++ ps' blockToParagraphs (BlockQuote blks) = local (\r -> r{ envParaProps = (envParaProps r){pPropMarginLeft = Just 100} , envRunProps = (envRunProps r){rPropForceSize = Just blockQuoteSize}})$ |