@@ -216,6 +216,7 @@ data Layout = MetadataSlide { metadataSlideTitle :: [ParaElem]
216216data Shape = Pic PicProps FilePath [ParaElem]
217217 | GraphicFrame [Graphic] [ParaElem]
218218 | TextBox [Paragraph]
219+ | RawOOXMLShape String
219220 deriving (Show, Eq)
220221
221222type Cell = [Paragraph]
@@ -266,6 +267,7 @@ data ParaElem = Break
266267 -- `convertmath` from T.P.Writers.Math. Will perhaps
267268 -- revisit in the future.
268269 | MathElem MathType TeXString
270+ | RawOOXMLParaElem String
269271 deriving (Show, Eq)
270272
271273data Strikethrough = NoStrike | SingleStrike | DoubleStrike
@@ -382,7 +384,11 @@ inlineToParElems (Quoted quoteType ils) =
382384 where (open, close) = case quoteType of
383385 SingleQuote -> ("\x2018", "\x2019")
384386 DoubleQuote -> ("\x201C", "\x201D")
385−inlineToParElems (RawInline _ _) = return []
387+inlineToParElems il@(RawInline fmt s) =
388+ case fmt of
389+ Format "openxml" -> return [RawOOXMLParaElem s]
390+ _ -> do addLogMessage $ InlineNotRendered il
391+ return []
386392inlineToParElems (Cite _ ils) = inlinesToParElems ils
387393-- Note: we shouldn't reach this, because images should be handled at
388394-- the shape level, but should that change in the future, we render
@@ -446,7 +452,8 @@ blockToParagraphs (BlockQuote blks) =
446452 , envRunProps = (envRunProps r){rPropForceSize = Just blockQuoteSize}})$
447453 concatMapM blockToParagraphs blks
448454-- TODO: work out the format
449−blockToParagraphs (RawBlock _ _) = return []
455+blockToParagraphs blk@(RawBlock _ _) = do addLogMessage $ BlockNotRendered blk
456+ return []
450457blockToParagraphs (Header _ (ident, _, _) ils) = do
451458 -- Note that this function only deals with content blocks, so it
452459 -- will only touch headers that are above the current slide level --
@@ -547,6 +554,8 @@ blockToShape (Table caption algn _ hdrCells rows) = do
547554 }
548555
549556 return $ GraphicFrame [Tbl tblPr hdrCells' rows'] caption'
557+-- If the format isn't openxml, we fall through to blockToPargraphs
558+blockToShape (RawBlock (Format "openxml") str) = return $ RawOOXMLShape str
550559blockToShape blk = do paras <- blockToParagraphs blk
551560 let paras' = map (\par -> par{paraElems = combineParaElems $ paraElems par}) paras
552561 return $ TextBox paras'
@@ -809,6 +818,7 @@ applyToShape :: Monad m => (ParaElem -> m ParaElem) -> Shape -> m Shape
809818applyToShape f (Pic pPr fp pes) = Pic pPr fp <$> mapM f pes
810819applyToShape f (GraphicFrame gfx pes) = GraphicFrame gfx <$> mapM f pes
811820applyToShape f (TextBox paras) = TextBox <$> mapM (applyToParagraph f) paras
821+applyToShape _ (RawOOXMLShape str) = return $ RawOOXMLShape str
812822
813823applyToLayout :: Monad m => (ParaElem -> m ParaElem) -> Layout -> m Layout
814824applyToLayout f (MetadataSlide title subtitle authors date) = do