mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
DocBook writer: render image alt text using textobject element.
See #8437.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -1357,6 +1357,9 @@ or here: <http://example.com/>
|
||||
Here is a movie <inlinemediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="movie.jpg" />
|
||||
<textobject>
|
||||
<phrase>movie</phrase>
|
||||
</textobject>
|
||||
</imageobject>
|
||||
</inlinemediaobject> icon.
|
||||
</para>
|
||||
|
||||
@@ -1332,6 +1332,9 @@ or here: <http://example.com/>
|
||||
Here is a movie <inlinemediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="movie.jpg" />
|
||||
<textobject>
|
||||
<phrase>movie</phrase>
|
||||
</textobject>
|
||||
</imageobject>
|
||||
</inlinemediaobject> icon.
|
||||
</para>
|
||||
|
||||
Reference in New Issue
Block a user