Merge pull request #3168 from hubertp-lshift/feature/odt-image-with-caption

[odt] proper formatting of an image with a caption
This commit is contained in:
John MacFarlane 2016-10-19 12:20:38 +02:00 committed by GitHub
commit 29cbd5cbcf
3 changed files with 8 additions and 4 deletions

View file

@ -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

View file

@ -1 +1 @@
[Para [Image ("",[],[("width","5.292cm"),("height","5.292cm")]) [Str "Abbildung",Space,Str "1:",Space,Str "Image",Space,Str "caption"] ("Pictures/10000000000000FA000000FAD6A15225.jpg","")]]
[Para [Image ("",[],[("width","5.292cm"),("height","5.292cm")]) [Str "Abbildung",Space,Str "1:",Space,Str "Image",Space,Str "caption"] ("Pictures/10000000000000FA000000FAD6A15225.jpg","fig:")]]

View file

@ -1 +1 @@
[Para [Image ("",[],[("width","5.292cm"),("height","5.292cm")]) [Str "Abbildung",Space,Str "1:",Space,Str "Image",Space,Str "caption"] ("Pictures/10000000000000FA000000FAD6A15225.jpg","")]]
[Para [Image ("",[],[("width","5.292cm"),("height","5.292cm")]) [Str "Abbildung",Space,Str "1:",Space,Str "Image",Space,Str "caption"] ("Pictures/10000000000000FA000000FAD6A15225.jpg","fig:")]]