@@ -117,6 +117,14 @@ isWhitespace '\x0c' = True
117117isWhitespace ' ' = True
118118isWhitespace _ = False
119119
120+orC :: (Char -> Bool) -> (Char -> Bool) -> Char -> Bool
121+orC f g c = f c || g c
122+{-# INLINE orC #-}
123+
124+isC :: Char -> Char -> Bool
125+isC = (==)
126+{-# INLINE isC #-}
127+
120128-- | /§8.2.4.8/: Tag name state: the open case
121129--
122130-- deviation: no lower-casing, don't handle NULL characters
@@ -140,7 +148,7 @@ tagName' :: Parser Text
140148tagName' = do
141149 c <- peekChar'
142150 guard $ isAsciiUpper c || isAsciiLower c
143− takeWhile $ notInClass "\x09\x0a\x0c /<>"
151+ takeWhile $ not . (isWhitespace `orC` isC '/' `orC` isC '<' `orC` isC '>')
144152
145153-- | /§8.2.4.40/: Self-closing start tag state
146154selfClosingStartTag :: TagName -> [Attr] -> Parser Token