diff options
author | Hubert Plociniczak <hubert.plociniczak@gmail.com> | 2016-10-17 16:50:03 +0200 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@gmail.com> | 2016-10-17 16:50:03 +0200 |
commit | 7234321e8f5e77422e2c1be7ac3264d302083767 (patch) | |
tree | 0054512bd8e1face8927963ed33d4ebd9d931fcf /src | |
parent | a02f276ff125eb9bede33524371cf8c7b660bb40 (diff) | |
download | pandoc-7234321e8f5e77422e2c1be7ac3264d302083767.tar.gz |
Minor refactoring
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Odt/ContentReader.hs | 16 |
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 |