summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/DocBook.hs8
-rw-r--r--test/writer.docbook43
-rw-r--r--test/writer.docbook53
3 files changed, 12 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/DocBook.hs b/src/Text/Pandoc/Writers/DocBook.hs
index db94a518e..c7db4c699 100644
--- a/src/Text/Pandoc/Writers/DocBook.hs
+++ b/src/Text/Pandoc/Writers/DocBook.hs
@@ -438,13 +438,17 @@ inlineToDocBook opts (Link attr txt (src, _))
then inTags False "link" $ ("xlink:href", src) : idAndRole attr
else inTags False "ulink" $ ("url", src) : idAndRole attr )
<$> inlinesToDocBook opts txt
-inlineToDocBook opts (Image attr _ (src, tit)) = return $
+inlineToDocBook opts (Image attr ils (src, tit)) = return $
let titleDoc = if T.null tit
then empty
else inTagsIndented "objectinfo" $
inTagsIndented "title" (literal $ escapeStringForXML tit)
+ alt = if null ils
+ then mempty
+ else inTagsIndented "textobject" $
+ inTags False "phrase" [] $ literal (stringify ils)
in inTagsIndented "inlinemediaobject" $ inTagsIndented "imageobject" $
- titleDoc $$ imageToDocBook opts attr src
+ titleDoc $$ imageToDocBook opts attr src $$ alt
inlineToDocBook opts (Note contents) =
inTagsIndented "footnote" <$> blocksToDocBook opts contents
diff --git a/test/writer.docbook4 b/test/writer.docbook4
index baf1937b5..af26f32c9 100644
--- a/test/writer.docbook4
+++ b/test/writer.docbook4
@@ -1357,6 +1357,9 @@ or here: &lt;http://example.com/&gt;
Here is a movie <inlinemediaobject>
<imageobject>
<imagedata fileref="movie.jpg" />
+ <textobject>
+ <phrase>movie</phrase>
+ </textobject>
</imageobject>
</inlinemediaobject> icon.
</para>
diff --git a/test/writer.docbook5 b/test/writer.docbook5
index dd73803aa..3d12495e6 100644
--- a/test/writer.docbook5
+++ b/test/writer.docbook5
@@ -1332,6 +1332,9 @@ or here: &lt;http://example.com/&gt;
Here is a movie <inlinemediaobject>
<imageobject>
<imagedata fileref="movie.jpg" />
+ <textobject>
+ <phrase>movie</phrase>
+ </textobject>
</imageobject>
</inlinemediaobject> icon.
</para>