aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-10-19 12:20:38 +0200
committerGitHub <noreply@github.com>2016-10-19 12:20:38 +0200
commit29cbd5cbcfd15c67fdb9d82105e18ae7a418358a (patch)
tree28561752aaf9384f6918e389d94afb9e0d6c7111 /src/Text
parent4a2a7a21e5e8bf0d11abd214d372729eb9eb8d0c (diff)
parentdd799df0aed2df843c6881cec296869b622c0780 (diff)
downloadpandoc-29cbd5cbcfd15c67fdb9d82105e18ae7a418358a.tar.gz
Merge pull request #3168 from hubertp-lshift/feature/odt-image-with-caption
[odt] proper formatting of an image with a caption
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Odt/ContentReader.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Odt/ContentReader.hs b/src/Text/Pandoc/Readers/Odt/ContentReader.hs
index 0b152268f..42f018157 100644
--- a/src/Text/Pandoc/Readers/Odt/ContentReader.hs
+++ b/src/Text/Pandoc/Readers/Odt/ContentReader.hs
@@ -779,8 +779,12 @@ read_frame_text_box = matchingElement NsDraw "text-box"
arr read_img_with_caption -< toList paragraphs
read_img_with_caption :: [Block] -> Inlines
-read_img_with_caption ((Para ((Image attr _ target) : txt)) : _) =
- singleton (Image attr txt target) -- override caption with the text that follows
+read_img_with_caption ((Para ((Image attr alt (src,title)) : [])) : _) =
+ singleton (Image attr alt (src, 'f':'i':'g':':':title)) -- no text, default caption
+read_img_with_caption ((Para ((Image attr _ (src,title)) : txt)) : _) =
+ singleton (Image attr txt (src, 'f':'i':'g':':':title) ) -- override caption with the text that follows
+read_img_with_caption ( (Para (_ : xs)) : ys) =
+ read_img_with_caption ((Para xs) : ys)
read_img_with_caption _ =
mempty