aboutsummaryrefslogtreecommitdiff
path: root/haddock-library/src/Documentation/Haddock
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-library/src/Documentation/Haddock')
-rw-r--r--haddock-library/src/Documentation/Haddock/Parser.hs8
-rw-r--r--haddock-library/src/Documentation/Haddock/Types.hs2
2 files changed, 5 insertions, 5 deletions
diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs
index 17240792..149ff93d 100644
--- a/haddock-library/src/Documentation/Haddock/Parser.hs
+++ b/haddock-library/src/Documentation/Haddock/Parser.hs
@@ -512,11 +512,11 @@ since = ("@since " *> version <* skipHorizontalSpace <* endOfLine) >>= setSince
header :: Parser (DocH mod Identifier)
header = do
let psers = map (string . flip T.replicate "=") [6, 5 .. 1]
- pser = choice' psers
- delim <- T.unpack <$> pser
- line <- skipHorizontalSpace *> nonEmptyLine >>= return . parseText
+ pser = Parsec.choice psers
+ depth <- T.length <$> pser
+ line <- parseText <$> (skipHorizontalSpace *> nonEmptyLine)
rest <- try paragraph <|> return DocEmpty
- return $ DocHeader (Header (length delim) line) `docAppend` rest
+ return $ DocHeader (Header depth line) `docAppend` rest
textParagraph :: Parser (DocH mod Identifier)
textParagraph = parseText . T.intercalate "\n" <$> some nonEmptyLine
diff --git a/haddock-library/src/Documentation/Haddock/Types.hs b/haddock-library/src/Documentation/Haddock/Types.hs
index 4cf61fee..d8c7a9fa 100644
--- a/haddock-library/src/Documentation/Haddock/Types.hs
+++ b/haddock-library/src/Documentation/Haddock/Types.hs
@@ -79,7 +79,7 @@ data Picture = Picture
} deriving (Eq, Show)
data Header id = Header
- { headerLevel :: Int
+ { headerLevel :: Int -- ^ between 1 and 6 inclusive
, headerTitle :: id
} deriving (Eq, Show, Functor, Foldable, Traversable)