summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-03-30 20:30:15 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-03-30 20:30:15 -0700
commit2b2f7fe15e2632fe123934ec105c8cc72cd593fd (patch)
tree0b67631fa4db3e43fc75c6c5c550b453a1a2cc2d /src/Text/Pandoc/Writers
parentc2cb64379ec24eadc43d8f4a48bf3b19b4e33624 (diff)
parent0d4d26294491b3f16e11231e90dc79ccd16b0b48 (diff)
Merge pull request #2035 from lierdakil/issue2031
Docx Writer/Reference: Add keepNext to objects w/ captions
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 8bb1d0ced..4e81def60 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -741,7 +741,12 @@ blockToOpenXML opts (Plain lst) = withParaProp (pCustomStyle "Compact")
-- title beginning with fig: indicates that the image is a figure
blockToOpenXML opts (Para [Image alt (src,'f':'i':'g':':':tit)]) = do
setFirstPara
+ pushParaProp $ pCustomStyle $
+ if null alt
+ then "Figure"
+ else "FigureWithCaption"
paraProps <- getParaProps False
+ popParaProp
contents <- inlinesToOpenXML opts [Image alt (src,tit)]
captionNode <- withParaProp (pCustomStyle "ImageCaption")
$ blockToOpenXML opts (Para alt)