diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index e2c8abd2e..f00ae12bf 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -393,7 +393,10 @@ blockToOpenDocument o bs mapM_ addParaStyle . newPara $ paraHStyles ++ paraStyles captionDoc <- if null c then return empty - else inlinesToOpenDocument o c >>= numberedTableCaption + else inlinesToOpenDocument o c >>= + if True -- temporary: see #5474 + then unNumberedCaption "TableCaption" + else numberedTableCaption th <- if all null h then return empty else colHeadsToOpenDocument o (map fst paraHStyles) h @@ -405,7 +408,10 @@ blockToOpenDocument o bs withParagraphStyle o "Figure" [Para [Image attr caption (source,title)]] | otherwise = do imageDoc <- withParagraphStyle o "FigureWithCaption" [Para [Image attr caption (source,title)]] - captionDoc <- inlinesToOpenDocument o caption >>= numberedFigureCaption + captionDoc <- inlinesToOpenDocument o caption >>= + if True -- temporary: see #5474 + then unNumberedCaption "FigureCaption" + else numberedFigureCaption return $ imageDoc $$ captionDoc @@ -434,6 +440,9 @@ numberedCaption style term name num caption = c = text ": " in inParagraphTagsWithStyle style $ hcat [ t, text " ", s, c, caption ] +unNumberedCaption :: Monad m => String -> Doc -> OD m Doc +unNumberedCaption style caption = return $ inParagraphTagsWithStyle style caption + colHeadsToOpenDocument :: PandocMonad m => WriterOptions -> [String] -> [[Block]] -> OD m Doc diff --git a/test/tables.opendocument b/test/tables.opendocument index 5c68476b8..250bce1b9 100644 --- a/test/tables.opendocument +++ b/test/tables.opendocument @@ -63,8 +63,8 @@ -Table 1: Demonstration -of simple table syntax. +Demonstration of simple table +syntax. Simple table without caption: @@ -197,8 +197,8 @@ spaces: -Table 2: Demonstration -of simple table syntax. +Demonstration of simple table +syntax. Multiline table with caption: @@ -253,8 +253,8 @@ caption: -Table 3: Here’s -the caption. It may span multiple lines. +Here’s the caption. It may span +multiple lines. Multiline table without caption: diff --git a/test/writer.opendocument b/test/writer.opendocument index 2d9068d07..95e909029 100644 --- a/test/writer.opendocument +++ b/test/writer.opendocument @@ -1879,7 +1879,7 @@ link in pointy braces. From “Voyage dans la Lune” by Georges Melies (1902): -Figure 1: lalune +lalune Here is a movie icon.