git.iko.soy/typeable/pandoc
on master help sign in
Minor refactoring
7234321Hubert Plociniczak
src/Text/Pandoc/Readers/Odt/ContentReader.hs+6−10
@@ -776,17 +776,13 @@ read_frame_text_box :: InlineMatcher
776read_frame_text_box = matchingElement NsDraw "text-box"
776read_frame_text_box = matchingElement NsDraw "text-box"
777 $ proc blocks -> do
777 $ proc blocks -> do
778 paragraphs <- (matchChildContent' [ read_paragraph ]) -< blocks
778 paragraphs <- (matchChildContent' [ read_paragraph ]) -< blocks
779− case toList paragraphs of
779+ arr read_img_with_caption -< toList paragraphs
780− (p : []) -> -- require only a single paragraph
780+
781− arr read_img_with_caption -< p
782− _ ->
783− arr fromList -< []
784−
785−read_img_with_caption :: Block -> Inlines
781+read_img_with_caption :: [Block] -> Inlines
786−read_img_with_caption (Para ((Image attr _ target) : txt)) =
782+read_img_with_caption ((Para ((Image attr _ target) : txt)) : _) =
787− singleton (Image attr txt target) -- override caption with the text that follows
783+ singleton (Image attr txt target) -- override caption with the text that follows
788read_img_with_caption _ =
784read_img_with_caption _ =
789− fromList []
785+ mempty
790
786
791----------------------
787----------------------
792-- Internal links
788-- Internal links