aboutsummaryrefslogtreecommitdiff
path: root/haddock-library/test/Documentation/Haddock
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-library/test/Documentation/Haddock')
-rw-r--r--haddock-library/test/Documentation/Haddock/ParserSpec.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs
index 9bf9b6ea..f264dbba 100644
--- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs
+++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs
@@ -289,8 +289,10 @@ spec = do
it "parses a single word anchor" $ do
"#foo#" `shouldParseTo` DocAName "foo"
- it "parses a multi word anchor" $ do
- "#foo bar#" `shouldParseTo` DocAName "foo bar"
+ -- Spaces are not allowed:
+ -- https://www.w3.org/TR/html51/dom.html#the-id-attribute
+ it "doesn't parse a multi word anchor" $ do
+ "#foo bar#" `shouldParseTo` "#foo bar#"
it "parses a unicode anchor" $ do
"#灼眼のシャナ#" `shouldParseTo` DocAName "灼眼のシャナ"
@@ -305,6 +307,9 @@ spec = do
it "does not accept empty anchors" $ do
"##" `shouldParseTo` "##"
+ it "does not accept anchors containing spaces" $ do
+ "{-# LANGUAGE GADTs #-}" `shouldParseTo` "{-# LANGUAGE GADTs #-}"
+
context "when parsing emphasised text" $ do
it "emphasises a word on its own" $ do
"/foo/" `shouldParseTo` DocEmphasis "foo"