git.iko.soy/typeable/html-parse
on master help sign in
Do not allow '<' in tag names.

Regardless of what the spec says I'm strongly in favour of this change.

commit15cc25f87f4ebcde59dd09574eecc3b9650bcb22 authorMatthias Fischmann <mf@zerobuzz.net> dateSat 31 Dec 2016, 11:05 (10 years ago) parent0351058
1 file changed+2−2
Text/HTML/Parser.hs+2−2
Text/HTML/Parser.hs+2−2
@@ -124,7 +124,7 @@ tagName' :: Parser Text
124124tagName' = do
125125 c <- peekChar'
126126 guard $ isAsciiUpper c || isAsciiLower c
127− takeWhile $ notInClass "\x09\x0a\x0c />"
127+ takeWhile $ notInClass "\x09\x0a\x0c /<>"
128128
129129-- | /§8.2.4.43/: Self-closing start tag state
130130selfClosingStartTag :: TagName -> [Attr] -> Parser Token
@@ -146,7 +146,7 @@ beforeAttrName tag attrs = do
146146-- | /§8.2.4.35/: Attribute name state
147147attrName :: TagName -> [Attr] -> Parser Token
148148attrName tag attrs = do
149− name <- takeWhile $ notInClass "\x09\x0a\x0c /=>\x00"
149+ name <- takeWhile $ notInClass "\x09\x0a\x0c /=<>\x00"
150150 id $ (satisfy (inClass "\x09\x0a\x0c ") >> afterAttrName tag attrs name)
151151 <|> (char '/' >> selfClosingStartTag tag attrs)
152152 <|> (char '=' >> beforeAttrValue tag attrs name)