From 378603c7703c26caa17d8b9d6c7692c96dc5a8c2 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Wed, 2 Nov 2016 12:08:10 -0400 Subject: Docx writer: Handle title text in images. We already handled alt text. This just puts the image "title" into the docx "title" attr. --- src/Text/Pandoc/Writers/Docx.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc') 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 -- cgit v1.2.3