git.iko.soy/typeable/html-parse
on master help sign in
Avod inClass in attrName
418c943Ben Gamari
Text/HTML/Parser.hs+2−1
@@ -178,9 +178,10 @@ attrName tag attrs = do
178 <|> (char '=' >> beforeAttrValue tag attrs name)
178 <|> (char '=' >> beforeAttrValue tag attrs name)
179 <|> try (do mc <- peekChar
179 <|> try (do mc <- peekChar
180 case mc of
180 case mc of
181− Just c | inClass "\x09\x0a\x0c />" c -> afterAttrName tag attrs name
181+ Just c | notNameChar c -> afterAttrName tag attrs name
182 _ -> empty)
182 _ -> empty)
183 -- <|> -- TODO: NULL
183 -- <|> -- TODO: NULL
184+ where notNameChar = isWhitespace `orC` isC '/' `orC` isC '>'
184
185
185-- | /§8.2.4.34/: After attribute name state
186-- | /§8.2.4.34/: After attribute name state
186afterAttrName :: TagName -> [Attr] -> AttrName -> Parser Token
187afterAttrName :: TagName -> [Attr] -> AttrName -> Parser Token