From b2127311cb360479dbea59264ada0112a94d7819 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 26 Jun 2014 12:34:41 -0700 Subject: Require haddock-library >= 1.1 and simplify haddock reader code. See #1346. --- src/Text/Pandoc/Readers/Haddock.hs | 40 +------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/Haddock.hs b/src/Text/Pandoc/Readers/Haddock.hs index a3dfb7c3c..4b46c869d 100644 --- a/src/Text/Pandoc/Readers/Haddock.hs +++ b/src/Text/Pandoc/Readers/Haddock.hs @@ -43,11 +43,8 @@ docHToBlocks d' = (docHToInlines False $ headerTitle h) DocAppend d1 d2 -> mappend (docHToBlocks d1) (docHToBlocks d2) DocString _ -> inlineFallback - DocParagraph (DocHeader h) -> docHToBlocks (DocHeader h) DocParagraph (DocAName h) -> B.plain $ docHToInlines False $ DocAName h - DocParagraph x -> let (ils, rest) = getInlines x - in (B.para $ docHToInlines False ils) - <> docHToBlocks rest + DocParagraph x -> B.para $ docHToInlines False x DocIdentifier _ -> inlineFallback DocIdentifierUnchecked _ -> inlineFallback DocModule s -> B.plain $ docHToInlines False $ DocModule s @@ -115,40 +112,6 @@ docHToInlines isCode d' = DocProperty _ -> mempty DocExamples _ -> mempty -getInlines :: DocH String Identifier -> (DocH String Identifier, DocH String Identifier) -getInlines (DocAppend x y) = if isInline x - then let (a, b) = getInlines y - in (DocAppend x a, b) - else (DocEmpty, DocAppend x y) -getInlines x = if isInline x - then (x, DocEmpty) - else (DocEmpty, x) - -isInline :: DocH String Identifier -> Bool -isInline d' = - case d' of - DocEmpty -> True - DocAppend d1 _ -> isInline d1 - DocString _ -> True - DocParagraph _ -> False - DocIdentifier _ -> True - DocIdentifierUnchecked _ -> True - DocModule _ -> True - DocWarning _ -> True - DocEmphasis _ -> True - DocMonospaced _ -> True - DocBold _ -> True - DocHeader _ -> False - DocUnorderedList _ -> False - DocOrderedList _ -> False - DocDefList _ -> False - DocCodeBlock _ -> False - DocHyperlink _ -> True - DocPic _ -> True - DocAName _ -> True - DocProperty _ -> False - DocExamples _ -> False - -- | Create an 'Example', stripping superfluous characters as appropriate makeExample :: String -> String -> [String] -> Blocks makeExample prompt expression result = @@ -173,4 +136,3 @@ makeExample prompt expression result = substituteBlankLine "" = "" substituteBlankLine line = line coder = B.codeWith ([], ["result"], []) - -- cgit v1.2.3