@@ -312,7 +312,7 @@ withNewStyle a = proc x -> do
312312 where
313313 isCodeStyle :: StyleName -> Bool
314314 isCodeStyle "Source_Text" = True
315− isCodeStyle _ = False
315+ isCodeStyle _ = False
316316
317317 inlineCode :: Inlines -> Inlines
318318 inlineCode = code . intercalate "" . map stringify . toList
@@ -415,12 +415,18 @@ constructPara reader = proc blocks -> do
415415 fStyle <- readStyleByName -< blocks
416416 case fStyle of
417417 Left _ -> reader -< blocks
418+ Right (styleName, _) | isTableCaptionStyle styleName -> do
419+ blocks' <- reader -< blocks
420+ arr tableCaptionP -< blocks'
418421 Right (_, style) -> do
419422 let modifier = getParaModifier style
420− blocks' <- reader -< blocks
421− arr modifier -<< blocks'
422−
423−
423+ blocks' <- reader -< blocks
424+ arr modifier -<< blocks'
425+ where
426+ isTableCaptionStyle :: StyleName -> Bool
427+ isTableCaptionStyle "Table" = True
428+ isTableCaptionStyle _ = False
429+ tableCaptionP b = divWith ("", ["caption"], []) b
424430
425431type ListConstructor = [Blocks] -> Blocks
426432
@@ -904,6 +910,15 @@ read_text = matchChildContent' [ read_header
904910 ]
905911 >>^ doc
906912
913+post_process :: Pandoc -> Pandoc
914+post_process (Pandoc m blocks) =
915+ Pandoc m (post_process' blocks)
916+
917+post_process' :: [Block] -> [Block]
918+post_process' ((Table _ a w h r) : (Div ("", ["caption"], _) [Para inlines] ) : xs) =
919+ (Table inlines a w h r) : ( post_process' xs )
920+post_process' bs = bs
921+
907922read_body :: OdtReader _x (Pandoc, MediaBag)
908923read_body = executeIn NsOffice "body"
909924 $ executeIn NsOffice "text"
@@ -911,4 +926,4 @@ read_body = executeIn NsOffice "body"
911926 $ proc inlines -> do
912927 txt <- read_text -< inlines
913928 state <- getExtraState -< ()
914− returnA -< (txt, getMediaBag state)
929+ returnA -< (post_process txt, getMediaBag state)