aboutsummaryrefslogtreecommitdiff
path: root/haddock-library/test
diff options
context:
space:
mode:
authorMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-07-28 13:25:43 +0200
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-07-28 13:25:43 +0200
commitd6aec63c009c4e57181900eb03847d7dc0fc3c7c (patch)
treeddee70d875782103c8ce4717008d0c790b5a60ec /haddock-library/test
parentb99b57c0df072d12b67816b45eca2a03cb1da96d (diff)
Catch mid-line URLs. Fixes #314.
Diffstat (limited to 'haddock-library/test')
-rw-r--r--haddock-library/test/Documentation/Haddock/ParserSpec.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs
index a8c2199a..5181a3f3 100644
--- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs
+++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs
@@ -137,6 +137,10 @@ spec = do
"http://example.com/? Some other sentence." `shouldParseTo`
hyperlink "http://example.com/" Nothing <> "? Some other sentence."
+ it "autolinks URLs occuring mid-sentence with multiple ‘/’s" $ do
+ "foo https://example.com/example bar" `shouldParseTo`
+ "foo " <> hyperlink "https://example.com/example" Nothing <> " bar"
+
context "when parsing pictures" $ do
let picture :: String -> Maybe String -> Doc String
picture uri = DocPic . Picture uri