diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-05-30 10:07:28 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-05-30 10:07:28 -0700 |
commit | c2f46e6df4a80a313ab4329b740770dbdfbe1578 (patch) | |
tree | 6eb92122a332ab6df22dc1bdd1739256e30dd407 /src/Text/Pandoc/Writers/Docx/Table.hs | |
parent | f363f00db8829b2aba774a588443720098d28ed8 (diff) | |
download | pandoc-c2f46e6df4a80a313ab4329b740770dbdfbe1578.tar.gz |
Docx writer: fix regression on captions.
The "Table Caption" style was no longer getting applied.
(It was overwritten by "Compact.")
Closes #7328.
Diffstat (limited to 'src/Text/Pandoc/Writers/Docx/Table.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/Docx/Table.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Docx/Table.hs b/src/Text/Pandoc/Writers/Docx/Table.hs index e7fc82a10..13cb31040 100644 --- a/src/Text/Pandoc/Writers/Docx/Table.hs +++ b/src/Text/Pandoc/Writers/Docx/Table.hs @@ -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 |