summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-06-26 12:34:41 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-06-26 12:35:13 -0700
commitb2127311cb360479dbea59264ada0112a94d7819 (patch)
tree10a9595e52b53e347c803215dec9e117e8e81695 /src
parent9f694619cd62992097df25690b1fbfe964d6c32e (diff)
Require haddock-library >= 1.1 and simplify haddock reader code.
See #1346.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Haddock.hs40
1 files changed, 1 insertions, 39 deletions
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 "<BLANKLINE>" = ""
substituteBlankLine line = line
coder = B.codeWith ([], ["result"], [])
-