@@ -22,7 +22,7 @@ import qualified Data.Set as Set
2222-- Returns tag type and whole tag.
2323pHtmlTag :: Parser (HtmlTagType , Text )
2424pHtmlTag = do
25- char ' <'
25+ _ <- char ' <'
2626 -- do not end the tag with a > character in a quoted attribute.
2727 closing <- (char ' /' >> return True ) <|> return False
2828 tagname <- takeWhile1 (\ c -> isAsciiAlphaNum c || c == ' ?' || c == ' !' )
@@ -36,7 +36,7 @@ pHtmlTag = do
3636 return $ ss <> T. singleton x <> xs <> " =" <> v
3737 attrs <- T. concat <$> many attr
3838 final <- takeWhile (\ c -> isSpace c || c == ' /' )
39- char ' >'
39+ _ <- char ' >'
4040 let tagtype = if closing
4141 then Closing tagname'
4242 else case T. stripSuffix " /" final of
@@ -57,7 +57,7 @@ pQuoted c = do
5757-- do for now.
5858pHtmlComment :: Parser Text
5959pHtmlComment = do
60- string " <!--"
60+ _ <- string " <!--"
6161 rest <- manyTill anyChar (string " -->" )
6262 return $ " <!--" <> T. pack rest <> " -->"
6363
@@ -118,7 +118,7 @@ pLinkTitle = do
118118pReference :: Parser (Text , Text , Text )
119119pReference = do
120120 lab <- pLinkLabel
121- char ' :'
121+ _ <- char ' :'
122122 scanSpnl
123123 url <- pLinkUrl
124124 tit <- option T. empty $ scanSpnl >> pLinkTitle
@@ -239,7 +239,7 @@ schemeSet = Set.fromList $ schemes ++ map T.toUpper schemes
239239-- Parse a URI, using heuristics to avoid capturing final punctuation.
240240pUri :: Text -> Parser Inlines
241241pUri scheme = do
242- char ' :'
242+ _ <- char ' :'
243243 x <- scan (OpenParens 0 ) uriScanner
244244 guard $ not $ T. null x
245245 let (rawuri, endingpunct) =
@@ -344,11 +344,11 @@ pLink refmap = do
344344-- An inline link: [label](/url "optional title")
345345pInlineLink :: Inlines -> Parser Inlines
346346pInlineLink lab = do
347- char ' ('
347+ _ <- char ' ('
348348 scanSpaces
349349 url <- pLinkUrl
350350 tit <- option " " $ scanSpnl *> pLinkTitle <* scanSpaces
351- char ' )'
351+ _ <- char ' )'
352352 return $ singleton $ Link lab (Url url) tit
353353
354354-- A reference link: [label], [foo][label], or [label][].
@@ -361,7 +361,7 @@ pReferenceLink _ rawlab lab = do
361361-- An image: ! followed by a link.
362362pImage :: ReferenceMap -> Parser Inlines
363363pImage refmap = do
364- char ' !'
364+ _ <- char ' !'
365365 (linkToImage <$> pLink refmap) <|> return (singleton (Str " !" ))
366366
367367linkToImage :: Inlines -> Inlines
@@ -377,23 +377,23 @@ linkToImage ils =
377377-- convert them to characters and store them as Str inlines.
378378pEntity :: Parser Inlines
379379pEntity = do
380- char ' &'
380+ _ <- char ' &'
381381 res <- pCharEntity <|> pDecEntity <|> pHexEntity
382- char ' ;'
382+ _ <- char ' ;'
383383 return $ singleton $ Entity $ " &" <> res <> " ;"
384384
385385pCharEntity :: Parser Text
386386pCharEntity = takeWhile1 (\ c -> isAscii c && isLetter c)
387387
388388pDecEntity :: Parser Text
389389pDecEntity = do
390- char ' #'
390+ _ <- char ' #'
391391 res <- takeWhile1 isDigit
392392 return $ " #" <> res
393393
394394pHexEntity :: Parser Text
395395pHexEntity = do
396- char ' #'
396+ _ <- char ' #'
397397 x <- char ' X' <|> char ' x'
398398 res <- takeWhile1 isHexDigit
399399 return $ " #" <> T. singleton x <> res
0 commit comments