summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@gmail.com>2016-10-17 16:50:03 +0200
committerHubert Plociniczak <hubert.plociniczak@gmail.com>2016-10-17 16:50:03 +0200
commit7234321e8f5e77422e2c1be7ac3264d302083767 (patch)
tree0054512bd8e1face8927963ed33d4ebd9d931fcf
parenta02f276ff125eb9bede33524371cf8c7b660bb40 (diff)
Minor refactoring
-rw-r--r--src/Text/Pandoc/Readers/Odt/ContentReader.hs16
1 files changed, 6 insertions, 10 deletions
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