summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-04-04 17:21:02 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-04-04 17:21:02 +0200
commit48729f9715f4deec6d621c363fd4d16d089497b2 (patch)
treec09eb3d29dd06dd9a619a36933997f00d0a84d53 /src/Text/Pandoc
parent65b692b41318657ba1c9c5a04c733357ade0a471 (diff)
Ms writer improvements:
- added some variables to the default template. - cleaner output for images (stringify alt text).
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Ms.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
index aadbd208e..4118a7bfb 100644
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -516,10 +516,9 @@ inlineToMs opts (Link _ txt (src, _)) = do
doubleQuotes (text (escapeUri src)) <> text " -A " <>
doubleQuotes (text "\\c") <> space <> text "\\") <> cr <>
text " -- " <> doubleQuotes (nowrap contents) <> cr <> text "\\&"
-inlineToMs opts (Image attr alternate (source, tit)) = do
- let alt = if null alternate then [Str "image"] else alternate
- linkPart <- inlineToMs opts (Link attr alt (source, tit))
- return $ char '[' <> text "IMAGE: " <> linkPart <> char ']'
+inlineToMs _ (Image _ alternate (_, _)) =
+ return $ char '[' <> text "IMAGE: " <>
+ text (escapeString (stringify alternate)) <> char ']'
inlineToMs _ (Note contents) = do
modify $ \st -> st{ stNotes = contents : stNotes st }
return $ text "\\**"