aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2016-11-02 12:08:10 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2016-11-02 12:10:45 -0400
commit378603c7703c26caa17d8b9d6c7692c96dc5a8c2 (patch)
treefc4d3f4eababa7e6f149713e1995e6c9a4841625 /src
parenteffc348965f20f4131ac3b0357303c548d851308 (diff)
downloadpandoc-378603c7703c26caa17d8b9d6c7692c96dc5a8c2.tar.gz
Docx writer: Handle title text in images.
We already handled alt text. This just puts the image "title" into the docx "title" attr.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index dfa011784..b59227647 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -1169,7 +1169,7 @@ inlineToOpenXML' opts (Link _ txt (src,_)) = do
M.insert src i extlinks }
return i
return [ mknode "w:hyperlink" [("r:id",id')] contents ]
-inlineToOpenXML' opts (Image attr alt (src, _)) = do
+inlineToOpenXML' opts (Image attr alt (src, title)) = do
-- first, check to see if we've already done this image
pageWidth <- asks envPrintWidth
imgs <- gets stImages
@@ -1220,7 +1220,7 @@ inlineToOpenXML' opts (Image attr alt (src, _)) = do
mknode "wp:inline" []
[ mknode "wp:extent" [("cx",show xemu),("cy",show yemu)] ()
, mknode "wp:effectExtent" [("b","0"),("l","0"),("r","0"),("t","0")] ()
- , mknode "wp:docPr" [("descr",stringify alt),("id","1"),("name","Picture")] ()
+ , mknode "wp:docPr" [("descr",stringify alt), ("title", title), ("id","1"),("name","Picture")] ()
, graphic ]
let imgext = case mt >>= extensionFromMimeType of
Just x -> '.':x