This repository was archived by the owner on Aug 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/Documentation/Haddock/Parser
test/Documentation/Haddock Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -149,9 +149,9 @@ takeIdentifier input = listToMaybe $ do
149
149
| otherwise = Nothing
150
150
151
151
-- | Parse all but the last quote off the front of the input
152
- -- PRECONDITION: T.head t == '\''
152
+ -- PRECONDITION: T.head t `elem` [ '\'', '`']
153
153
quotes :: Text -> (Int , Text )
154
- quotes t = let ! n = T. length (T. takeWhile (== ' \' ' ) t) - 1
154
+ quotes t = let ! n = T. length (T. takeWhile (`elem` [ ' \' ' , ' ` ' ] ) t) - 1
155
155
in (n, T. drop n t)
156
156
157
157
-- | Parse an operator off the front of the input
Original file line number Diff line number Diff line change @@ -121,6 +121,9 @@ spec = do
121
121
it " can parse identifiers ending with a single quote" $ do
122
122
" 'foo''" `shouldParseTo` DocIdentifier " foo'"
123
123
124
+ it " can parse identifiers in backticks ending with a single quote" $ do
125
+ " `foo'`" `shouldParseTo` DocIdentifier " foo'"
126
+
124
127
it " can parse an identifier containing a digit" $ do
125
128
" 'f0'" `shouldParseTo` DocIdentifier " f0"
126
129
You can’t perform that action at this time.
0 commit comments