From 4a7dad18b109987cfa13168a9f5505c183744d99 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Tue, 27 Aug 2019 01:16:21 -0400 Subject: PowerPoint writer: Start numbering at appopriate numbers. Starting numbers for ordered lists were previously ignored. Now we specify the number if it is something other than 1. Closes: #5709 --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/Text/Pandoc/Writers/Powerpoint') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index eed35565e..79a5ed65f 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -861,7 +861,7 @@ paragraphToElement par = do (case pPropBullet $ paraProps par of Just Bullet -> [] Just (AutoNumbering attrs') -> - [mknode "a:buAutoNum" [("type", autoNumberingToType attrs')] ()] + [mknode "a:buAutoNum" (autoNumAttrs attrs') ()] Nothing -> [mknode "a:buNone" [] ()] ) paras <- concat <$> mapM paraElemToElements (paraElems par) @@ -1872,10 +1872,14 @@ getContentType fp Just $ presML ++ ".slideLayout+xml" | otherwise = Nothing -autoNumberingToType :: ListAttributes -> String -autoNumberingToType (_, numStyle, numDelim) = - typeString ++ delimString +autoNumAttrs :: ListAttributes -> [(String, String)] +autoNumAttrs (startNum, numStyle, numDelim) = + numAttr ++ typeAttr where + numAttr = if startNum == 1 + then [] + else [("startAt", show startNum)] + typeAttr = [("type", typeString ++ delimString)] typeString = case numStyle of Decimal -> "arabic" UpperAlpha -> "alphaUc" -- cgit v1.2.3