aboutsummaryrefslogtreecommitdiff
path: root/haddock-library
diff options
context:
space:
mode:
authorSimon Jakobi <simon.jakobi@gmail.com>2018-03-14 14:21:18 +0100
committerAlexander Biehl <alexbiehl@gmail.com>2018-03-14 20:39:29 +0100
commite787b5712157bb0acbb8d886ef793cda5dc1b821 (patch)
treef0b363aac83cb282e8ac046924ee78fe9c7f37d4 /haddock-library
parent754ce4715eac6076ff9f829418358127228408e3 (diff)
Make a proper definition for the <link> parser
Diffstat (limited to 'haddock-library')
-rw-r--r--haddock-library/src/Documentation/Haddock/Parser.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs
index 250b7f0d..6cbc3922 100644
--- a/haddock-library/src/Documentation/Haddock/Parser.hs
+++ b/haddock-library/src/Documentation/Haddock/Parser.hs
@@ -742,10 +742,12 @@ codeblock =
| otherwise = Just $ c == '\n'
hyperlink :: Parser (DocH mod a)
-hyperlink = DocHyperlink . makeLabeled Hyperlink . decodeUtf8
- <$> disallowNewline ("<" *> takeUntil ">")
- <|> autoUrl
- <|> markdownLink
+hyperlink = angleBracketLink <|> markdownLink <|> autoUrl
+
+angleBracketLink :: Parser (DocH mod a)
+angleBracketLink =
+ DocHyperlink . makeLabeled Hyperlink . decodeUtf8
+ <$> disallowNewline ("<" *> takeUntil ">")
markdownLink :: Parser (DocH mod a)
markdownLink = DocHyperlink <$> linkParser