@@ -216,6 +216,7 @@ data Layout = MetadataSlide { metadataSlideTitle :: [ParaElem]
216data Shape = Pic PicProps FilePath [ParaElem]
216data Shape = Pic PicProps FilePath [ParaElem]
217 | GraphicFrame [Graphic] [ParaElem]
217 | GraphicFrame [Graphic] [ParaElem]
218 | TextBox [Paragraph]
218 | TextBox [Paragraph]
219+ | RawOOXMLShape String
219 deriving (Show, Eq)
220 deriving (Show, Eq)
221type Cell = [Paragraph]
222type Cell = [Paragraph]
@@ -266,6 +267,7 @@ data ParaElem = Break
266 -- `convertmath` from T.P.Writers.Math. Will perhaps
267 -- `convertmath` from T.P.Writers.Math. Will perhaps
267 -- revisit in the future.
268 -- revisit in the future.
268 | MathElem MathType TeXString
269 | MathElem MathType TeXString
270+ | RawOOXMLParaElem String
269 deriving (Show, Eq)
271 deriving (Show, Eq)
271data Strikethrough = NoStrike | SingleStrike | DoubleStrike
273data Strikethrough = NoStrike | SingleStrike | DoubleStrike
@@ -382,7 +384,11 @@ inlineToParElems (Quoted quoteType ils) =
382 where (open, close) = case quoteType of
384 where (open, close) = case quoteType of
383 SingleQuote -> ("\x2018", "\x2019")
385 SingleQuote -> ("\x2018", "\x2019")
384 DoubleQuote -> ("\x201C", "\x201D")
386 DoubleQuote -> ("\x201C", "\x201D")
385−inlineToParElems (RawInline _ _) = return []
387+inlineToParElems il@(RawInline fmt s) =
389+ Format "openxml" -> return [RawOOXMLParaElem s]
390+ _ -> do addLogMessage $ InlineNotRendered il
386inlineToParElems (Cite _ ils) = inlinesToParElems ils
392inlineToParElems (Cite _ ils) = inlinesToParElems ils
387-- Note: we shouldn't reach this, because images should be handled at
393-- Note: we shouldn't reach this, because images should be handled at
388-- the shape level, but should that change in the future, we render
394-- the shape level, but should that change in the future, we render
@@ -446,7 +452,8 @@ blockToParagraphs (BlockQuote blks) =
446 , envRunProps = (envRunProps r){rPropForceSize = Just blockQuoteSize}})$
452 , envRunProps = (envRunProps r){rPropForceSize = Just blockQuoteSize}})$
447 concatMapM blockToParagraphs blks
453 concatMapM blockToParagraphs blks
448-- TODO: work out the format
454-- TODO: work out the format
449−blockToParagraphs (RawBlock _ _) = return []
455+blockToParagraphs blk@(RawBlock _ _) = do addLogMessage $ BlockNotRendered blk
450blockToParagraphs (Header _ (ident, _, _) ils) = do
457blockToParagraphs (Header _ (ident, _, _) ils) = do
451 -- Note that this function only deals with content blocks, so it
458 -- Note that this function only deals with content blocks, so it
452 -- will only touch headers that are above the current slide level --
459 -- will only touch headers that are above the current slide level --
@@ -547,6 +554,8 @@ blockToShape (Table caption algn _ hdrCells rows) = do
549 return $ GraphicFrame [Tbl tblPr hdrCells' rows'] caption'
556 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
550blockToShape blk = do paras <- blockToParagraphs blk
559blockToShape blk = do paras <- blockToParagraphs blk
551 let paras' = map (\par -> par{paraElems = combineParaElems $ paraElems par}) paras
560 let paras' = map (\par -> par{paraElems = combineParaElems $ paraElems par}) paras
552 return $ TextBox paras'
561 return $ TextBox paras'
@@ -809,6 +818,7 @@ applyToShape :: Monad m => (ParaElem -> m ParaElem) -> Shape -> m Shape
809applyToShape f (Pic pPr fp pes) = Pic pPr fp <$> mapM f pes
818applyToShape f (Pic pPr fp pes) = Pic pPr fp <$> mapM f pes
810applyToShape f (GraphicFrame gfx pes) = GraphicFrame gfx <$> mapM f pes
819applyToShape f (GraphicFrame gfx pes) = GraphicFrame gfx <$> mapM f pes
811applyToShape f (TextBox paras) = TextBox <$> mapM (applyToParagraph f) paras
820applyToShape f (TextBox paras) = TextBox <$> mapM (applyToParagraph f) paras
821+applyToShape _ (RawOOXMLShape str) = return $ RawOOXMLShape str
813applyToLayout :: Monad m => (ParaElem -> m ParaElem) -> Layout -> m Layout
823applyToLayout :: Monad m => (ParaElem -> m ParaElem) -> Layout -> m Layout
814applyToLayout f (MetadataSlide title subtitle authors date) = do
824applyToLayout f (MetadataSlide title subtitle authors date) = do