@@ -285,8 +285,12 @@ blocksToOpenDocument o b = vcat <$> mapM (blockToOpenDocument o) b
285-- | Convert a Pandoc block element to OpenDocument.
285-- | Convert a Pandoc block element to OpenDocument.
286blockToOpenDocument :: WriterOptions -> Block -> State WriterState Doc
286blockToOpenDocument :: WriterOptions -> Block -> State WriterState Doc
287blockToOpenDocument o bs
287blockToOpenDocument o bs
288+ | Plain b <- bs = if null b
288− | Plain b <- bs = inParagraphTags =<< inlinesToOpenDocument o b
290+ else inParagraphTags =<< inlinesToOpenDocument o b
291+ | Para b <- bs = if null b
289− | Para b <- bs = inParagraphTags =<< inlinesToOpenDocument o b
293+ else inParagraphTags =<< inlinesToOpenDocument o b
290 | Div _ xs <- bs = blocksToOpenDocument o xs
294 | Div _ xs <- bs = blocksToOpenDocument o xs
291 | Header i _ b <- bs = setFirstPara >>
295 | Header i _ b <- bs = setFirstPara >>
292 (inHeaderTags i =<< inlinesToOpenDocument o b)
296 (inHeaderTags i =<< inlinesToOpenDocument o b)
@@ -298,8 +302,8 @@ blockToOpenDocument o bs
298 | Table c a w h r <- bs = setFirstPara >> table c a w h r
302 | Table c a w h r <- bs = setFirstPara >> table c a w h r
299 | HorizontalRule <- bs = setFirstPara >> return (selfClosingTag "text:p"
303 | HorizontalRule <- bs = setFirstPara >> return (selfClosingTag "text:p"
300 [ ("text:style-name", "Horizontal_20_Line") ])
304 [ ("text:style-name", "Horizontal_20_Line") ])
301− | RawBlock f s <- bs = if f == "opendocument"
305+ | RawBlock f s <- bs = if f == Format "opendocument"
302− then preformatted s
306+ then return $ text s
303 else return empty
307 else return empty
304 | Null <- bs = return empty
308 | Null <- bs = return empty
305 | otherwise = return empty
309 | otherwise = return empty
@@ -378,8 +382,8 @@ inlineToOpenDocument o ils
378 | Code _ s <- ils = withTextStyle Pre $ inTextStyle $ preformatted s
382 | Code _ s <- ils = withTextStyle Pre $ inTextStyle $ preformatted s
379 | Math t s <- ils = inlinesToOpenDocument o (readTeXMath' t s)
383 | Math t s <- ils = inlinesToOpenDocument o (readTeXMath' t s)
380 | Cite _ l <- ils = inlinesToOpenDocument o l
384 | Cite _ l <- ils = inlinesToOpenDocument o l
381− | RawInline f s <- ils = if f == "opendocument"
385+ | RawInline f s <- ils = if f == Format "opendocument"
382− then return $ preformatted s
386+ then return $ text s
383 else return empty
387 else return empty
384 | Link l (s,t) <- ils = mkLink s t <$> inlinesToOpenDocument o l
388 | Link l (s,t) <- ils = mkLink s t <$> inlinesToOpenDocument o l
385 | Image _ (s,t) <- ils = mkImg s t
389 | Image _ (s,t) <- ils = mkImg s t