From 7234321e8f5e77422e2c1be7ac3264d302083767 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Mon, 17 Oct 2016 16:50:03 +0200 Subject: Minor refactoring --- src/Text/Pandoc/Readers/Odt/ContentReader.hs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/Text/Pandoc/Readers/Odt') diff --git a/src/Text/Pandoc/Readers/Odt/ContentReader.hs b/src/Text/Pandoc/Readers/Odt/ContentReader.hs index 166fce681..1aaff62e5 100644 --- a/src/Text/Pandoc/Readers/Odt/ContentReader.hs +++ b/src/Text/Pandoc/Readers/Odt/ContentReader.hs @@ -776,17 +776,13 @@ read_frame_text_box :: InlineMatcher read_frame_text_box = matchingElement NsDraw "text-box" $ proc blocks -> do paragraphs <- (matchChildContent' [ read_paragraph ]) -< blocks - case toList paragraphs of - (p : []) -> -- require only a single paragraph - arr read_img_with_caption -< p - _ -> - arr fromList -< [] - -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 + 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 _ = - fromList [] + mempty ---------------------- -- Internal links -- cgit v1.2.3