git.iko.soy/typeable/html-parse
on master help sign in
Avod inClass in attrName
commit418c943002830288f026c05e2a49a420a98a9dd3 authorBen Gamari <ben@smart-cactus.org> dateFri 2 Feb 2018, 21:46 (9 years ago) parent61a5788
1 file changed+2−1
Text/HTML/Parser.hs+2−1
Text/HTML/Parser.hs+2−1
@@ -178,9 +178,10 @@ attrName tag attrs = do
178178 <|> (char '=' >> beforeAttrValue tag attrs name)
179179 <|> try (do mc <- peekChar
180180 case mc of
181− Just c | inClass "\x09\x0a\x0c />" c -> afterAttrName tag attrs name
181+ Just c | notNameChar c -> afterAttrName tag attrs name
182182 _ -> empty)
183183 -- <|> -- TODO: NULL
184+ where notNameChar = isWhitespace `orC` isC '/' `orC` isC '>'
184185
185186-- | /§8.2.4.34/: After attribute name state
186187afterAttrName :: TagName -> [Attr] -> AttrName -> Parser Token