This repository was archived by the owner on Aug 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
src/Documentation/Haddock
test/Documentation/Haddock Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ takeWhile1_ = mfilter (not . T.null) . takeWhile_
227
227
-- DocAName "Hello world"
228
228
anchor :: Parser (DocH mod a )
229
229
anchor = DocAName . T. unpack <$>
230
- disallowNewline (" #" *> takeWhile1_ (/= ' #' ) <* " #" )
230
+ (" #" *> takeWhile1_ (\ x -> x /= ' #' && not (isSpace x) ) <* " #" )
231
231
232
232
-- | Monospaced strings.
233
233
--
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ data DocH mod id
126
126
| DocMathInline String
127
127
| DocMathDisplay String
128
128
| DocAName String
129
- -- ^ A (HTML) anchor.
129
+ -- ^ A (HTML) anchor. It must not contain any spaces.
130
130
| DocProperty String
131
131
| DocExamples [Example ]
132
132
| DocHeader (Header (DocH mod id ))
Original file line number Diff line number Diff line change @@ -288,9 +288,6 @@ spec = do
288
288
it " parses a single word anchor" $ do
289
289
" #foo#" `shouldParseTo` DocAName " foo"
290
290
291
- it " parses a multi word anchor" $ do
292
- " #foo bar#" `shouldParseTo` DocAName " foo bar"
293
-
294
291
it " parses a unicode anchor" $ do
295
292
" #灼眼のシャナ#" `shouldParseTo` DocAName " 灼眼のシャナ"
296
293
@@ -304,6 +301,9 @@ spec = do
304
301
it " does not accept empty anchors" $ do
305
302
" ##" `shouldParseTo` " ##"
306
303
304
+ it " does not accept anchors containing spaces" $ do
305
+ " {-# LANGUAGE GADTs #-}" `shouldParseTo` " {-# LANGUAGE GADTs #-}"
306
+
307
307
context " when parsing emphasised text" $ do
308
308
it " emphasises a word on its own" $ do
309
309
" /foo/" `shouldParseTo` DocEmphasis " foo"
You can’t perform that action at this time.
0 commit comments