git.iko.soy/typeable/pandoc
on master help sign in
Docx writer: fix regression on captions.
c2f46e6John MacFarlane
src/Text/Pandoc/Writers/Docx/Table.hs+3−1
@@ -33,7 +33,6 @@ tableToOpenXML :: PandocMonad m
33 -> WS m [Content]
33 -> WS m [Content]
34tableToOpenXML blocksToOpenXML gridTable = do
34tableToOpenXML blocksToOpenXML gridTable = do
35 setFirstPara
35 setFirstPara
36− modify $ \s -> s { stInTable = True }
37 let (Grid.Table _attr caption colspecs _rowheads thead tbodies tfoot) =
36 let (Grid.Table _attr caption colspecs _rowheads thead tbodies tfoot) =
38 gridTable
37 gridTable
39 let (Caption _maybeShortCaption captionBlocks) = caption
38 let (Caption _maybeShortCaption captionBlocks) = caption
@@ -43,6 +42,9 @@ tableToOpenXML blocksToOpenXML gridTable = do
43 then return []
42 then return []
44 else withParaPropM (pStyleM "Table Caption")
43 else withParaPropM (pStyleM "Table Caption")
45 $ blocksToOpenXML captionBlocks
44 $ blocksToOpenXML captionBlocks
45+ -- We set "in table" after processing the caption, because we don't
46+ -- want the "Table Caption" style to be overwritten with "Compact".
47+ modify $ \s -> s { stInTable = True }
46 head' <- cellGridToOpenXML blocksToOpenXML HeadRow aligns thead
48 head' <- cellGridToOpenXML blocksToOpenXML HeadRow aligns thead
47 bodies <- mapM (cellGridToOpenXML blocksToOpenXML BodyRow aligns) tbodies
49 bodies <- mapM (cellGridToOpenXML blocksToOpenXML BodyRow aligns) tbodies
48 foot' <- cellGridToOpenXML blocksToOpenXML FootRow aligns tfoot
50 foot' <- cellGridToOpenXML blocksToOpenXML FootRow aligns tfoot