Docx writer: fix regression on captions.

The "Table Caption" style was no longer getting applied.
(It was overwritten by "Compact.")

Closes #7328.
This commit is contained in:
John MacFarlane 2021-05-30 10:07:28 -07:00
parent f363f00db8
commit c2f46e6df4

View file

@ -33,7 +33,6 @@ tableToOpenXML :: PandocMonad m
-> WS m [Content]
tableToOpenXML blocksToOpenXML gridTable = do
setFirstPara
modify $ \s -> s { stInTable = True }
let (Grid.Table _attr caption colspecs _rowheads thead tbodies tfoot) =
gridTable
let (Caption _maybeShortCaption captionBlocks) = caption
@ -43,6 +42,9 @@ tableToOpenXML blocksToOpenXML gridTable = do
then return []
else withParaPropM (pStyleM "Table Caption")
$ blocksToOpenXML captionBlocks
-- We set "in table" after processing the caption, because we don't
-- want the "Table Caption" style to be overwritten with "Compact".
modify $ \s -> s { stInTable = True }
head' <- cellGridToOpenXML blocksToOpenXML HeadRow aligns thead
bodies <- mapM (cellGridToOpenXML blocksToOpenXML BodyRow aligns) tbodies
foot' <- cellGridToOpenXML blocksToOpenXML FootRow aligns tfoot