From 87b07c699a5f4be6a14d45984db4898405157a65 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 28 Feb 2024 10:05:15 -0800 Subject: Docx reader: ensure that table captions are counted. Normally these occur outside the table element itself, but they should still be parsed as captions in this case. Closes #9518. --- src/Text/Pandoc/Readers/Docx/Parse.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index 75ea68a4d..a6c1bf63a 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -793,9 +793,8 @@ elemToBodyPart ns element case pHeading parstyle of Nothing | Just (numId, lvl) <- pNumInfo parstyle -> do mkListItem parstyle numId lvl parparts - _ -> if isTable - then return $ TblCaption parstyle parparts - else return $ Paragraph parstyle parparts + _ -> return $ (if hasCaptionStyle then TblCaption else Paragraph) + parstyle parparts elemToBodyPart ns element | isElem ns "w" "tbl" element = do -- cgit v1.2.3