@@ -33,6 +33,7 @@ module Text.Pandoc.Writers.Powerpoint.Presentation ( documentToPresentation
3333 , TableProps(..)
3434 , Strikethrough(..)
3535 , Capitals(..)
36+ , Pixels
3637 , PicProps(..)
3738 , URL
3839 , TeXString(..)
@@ -226,6 +227,7 @@ data ParaProps = ParaProps { pPropMarginLeft :: Maybe Pixels
226227 , pPropBullet :: Maybe BulletType
227228 , pPropAlign :: Maybe Algnment
228229 , pPropSpaceBefore :: Maybe Pixels
230+ , pPropIndent :: Maybe Pixels
229231 } deriving (Show, Eq)
230232
231233instance Default ParaProps where
@@ -235,6 +237,7 @@ instance Default ParaProps where
235237 , pPropBullet = Nothing
236238 , pPropAlign = Nothing
237239 , pPropSpaceBefore = Nothing
240+ , pPropIndent = Just 0
238241 }
239242
240243newtype TeXString = TeXString {unTeXString :: String}
@@ -411,18 +414,23 @@ blockToParagraphs (LineBlock ilsList) = do
411414 pProps <- asks envParaProps
412415 return [Paragraph pProps parElems]
413416-- TODO: work out the attributes
414−blockToParagraphs (CodeBlock attr str) =
415− local (\r -> r{ envParaProps = def{pPropMarginLeft = Just 100}
417+blockToParagraphs (CodeBlock attr str) = do
418+ pProps <- asks envParaProps
419+ local (\r -> r{ envParaProps = def{ pPropMarginLeft = Nothing
420+ , pPropBullet = Nothing
421+ , pPropLevel = pPropLevel pProps
422+ , pPropIndent = Just 0
423+ }
416424 , envRunProps = (envRunProps r){rPropCode = True}}) $ do
417− mbSty <- writerHighlightStyle <$> asks envOpts
418− synMap <- writerSyntaxMap <$> asks envOpts
419− case mbSty of
420− Just sty ->
421− case highlight synMap (formatSourceLines sty) attr str of
422− Right pElems -> do pProps <- asks envParaProps
423− return [Paragraph pProps pElems]
424− Left _ -> blockToParagraphs $ Para [Str str]
425− Nothing -> blockToParagraphs $ Para [Str str]
425+ mbSty <- writerHighlightStyle <$> asks envOpts
426+ synMap <- writerSyntaxMap <$> asks envOpts
427+ case mbSty of
428+ Just sty ->
429+ case highlight synMap (formatSourceLines sty) attr str of
430+ Right pElems -> do pPropsNew <- asks envParaProps
431+ return [Paragraph pPropsNew pElems]
432+ Left _ -> blockToParagraphs $ Para [Str str]
433+ Nothing -> blockToParagraphs $ Para [Str str]
426434-- We can't yet do incremental lists, but we should render a
427435-- (BlockQuote List) as a list to maintain compatibility with other
428436-- formats.
@@ -431,7 +439,9 @@ blockToParagraphs (BlockQuote (blk : blks)) | isListType blk = do
431439 ps' <- blockToParagraphs $ BlockQuote blks
432440 return $ ps ++ ps'
433441blockToParagraphs (BlockQuote blks) =
434− local (\r -> r{ envParaProps = (envParaProps r){pPropMarginLeft = Just 100}
442+ local (\r -> r{ envParaProps = (envParaProps r){ pPropMarginLeft = Just 100
443+ , pPropIndent = Just 0
444+ }
435445 , envRunProps = (envRunProps r){rPropForceSize = Just blockQuoteSize}})$
436446 concatMapM blockToParagraphs blks
437447-- TODO: work out the format
@@ -455,6 +465,7 @@ blockToParagraphs (BulletList blksLst) = do
455465 , envParaProps = pProps{ pPropLevel = lvl + 1
456466 , pPropBullet = Just Bullet
457467 , pPropMarginLeft = Nothing
468+ , pPropIndent = Nothing
458469 }}) $
459470 concatMapM multiParBullet blksLst
460471blockToParagraphs (OrderedList listAttr blksLst) = do
@@ -464,6 +475,7 @@ blockToParagraphs (OrderedList listAttr blksLst) = do
464475 , envParaProps = pProps{ pPropLevel = lvl + 1
465476 , pPropBullet = Just (AutoNumbering listAttr)
466477 , pPropMarginLeft = Nothing
478+ , pPropIndent = Nothing
467479 }}) $
468480 concatMapM multiParBullet blksLst
469481blockToParagraphs (DefinitionList entries) = do