aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Texinfo.hs6
-rw-r--r--tests/writer.texinfo3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs
index bd77c57bb..47a318631 100644
--- a/src/Text/Pandoc/Writers/Texinfo.hs
+++ b/src/Text/Pandoc/Writers/Texinfo.hs
@@ -107,6 +107,12 @@ blockToTexinfo Null = return empty
blockToTexinfo (Plain lst) =
inlineListToTexinfo lst
+blockToTexinfo (Para [Image txt (src,tit)]) = do
+ capt <- inlineListToTexinfo txt
+ img <- inlineToTexinfo (Image txt (src,tit))
+ return $ text "@float" $$ img $$ (text "@caption{" <> capt <> char '}') $$
+ text "@end float"
+
blockToTexinfo (Para lst) =
inlineListToTexinfo lst -- this is handled differently from Plain in blockListToTexinfo
diff --git a/tests/writer.texinfo b/tests/writer.texinfo
index 65f7aa457..149b5a737 100644
--- a/tests/writer.texinfo
+++ b/tests/writer.texinfo
@@ -977,7 +977,10 @@ or here: <http://example.com/>
@chapter Images
From ``Voyage dans la Lune'' by Georges Melies (1902):
+@float
@image{lalune,,,lalune,jpg}
+@caption{lalune}
+@end float
Here is a movie @image{movie,,,movie,jpg} icon.