aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Extensions.hs1
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs14
2 files changed, 8 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs
index 121b60e7b..4d85eb2e6 100644
--- a/src/Text/Pandoc/Extensions.hs
+++ b/src/Text/Pandoc/Extensions.hs
@@ -132,6 +132,7 @@ data Extension =
| Ext_multiline_tables -- ^ Pandoc-style multiline tables
| Ext_native_divs -- ^ Use Div blocks for contents of <div> tags
| Ext_native_spans -- ^ Use Span inlines for contents of <span>
+ | Ext_native_numbering -- ^ Use output format's native numbering for figures and tables
| Ext_ntb -- ^ ConTeXt Natural Tables
| Ext_old_dashes -- ^ -- = em, - before number = en
| Ext_pandoc_title_block -- ^ Pandoc title block
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
index 3da778ae9..7a3aa4973 100644
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -397,9 +397,9 @@ blockToOpenDocument o bs
captionDoc <- if null c
then return empty
else inlinesToOpenDocument o c >>=
- if True -- temporary: see #5474
- then unNumberedCaption "TableCaption"
- else numberedTableCaption
+ if isEnabled Ext_native_numbering o
+ then numberedTableCaption
+ else unNumberedCaption "TableCaption"
th <- if all null h
then return empty
else colHeadsToOpenDocument o (map fst paraHStyles) h
@@ -412,9 +412,9 @@ blockToOpenDocument o bs
| otherwise = do
imageDoc <- withParagraphStyle o "FigureWithCaption" [Para [Image attr caption (source,title)]]
captionDoc <- inlinesToOpenDocument o caption >>=
- if True -- temporary: see #5474
- then unNumberedCaption "FigureCaption"
- else numberedFigureCaption
+ if isEnabled Ext_native_numbering o
+ then numberedFigureCaption
+ else unNumberedCaption "FigureCaption"
return $ imageDoc $$ captionDoc
@@ -423,7 +423,7 @@ numberedTableCaption caption = do
id' <- gets stTableCaptionId
modify (\st -> st{ stTableCaptionId = id' + 1 })
capterm <- translateTerm Term.Table
- return $ numberedCaption "Table" capterm "Table" id' caption
+ return $ numberedCaption "TableCaption" capterm "Table" id' caption
numberedFigureCaption :: PandocMonad m => Doc Text -> OD m (Doc Text)
numberedFigureCaption caption = do