git.iko.soy/typeable/html-parse
on master help sign in
Do not allow '<' in tag names.
15cc25fMatthias Fischmann
Text/HTML/Parser.hs+2−2
@@ -124,7 +124,7 @@ tagName' :: Parser Text
124tagName' = do
124tagName' = do
125 c <- peekChar'
125 c <- peekChar'
126 guard $ isAsciiUpper c || isAsciiLower c
126 guard $ isAsciiUpper c || isAsciiLower c
127− takeWhile $ notInClass "\x09\x0a\x0c />"
127+ takeWhile $ notInClass "\x09\x0a\x0c /<>"
128
128
129-- | /§8.2.4.43/: Self-closing start tag state
129-- | /§8.2.4.43/: Self-closing start tag state
130selfClosingStartTag :: TagName -> [Attr] -> Parser Token
130selfClosingStartTag :: TagName -> [Attr] -> Parser Token
@@ -146,7 +146,7 @@ beforeAttrName tag attrs = do
146-- | /§8.2.4.35/: Attribute name state
146-- | /§8.2.4.35/: Attribute name state
147attrName :: TagName -> [Attr] -> Parser Token
147attrName :: TagName -> [Attr] -> Parser Token
148attrName tag attrs = do
148attrName tag attrs = do
149− name <- takeWhile $ notInClass "\x09\x0a\x0c /=>\x00"
149+ name <- takeWhile $ notInClass "\x09\x0a\x0c /=<>\x00"
150 id $ (satisfy (inClass "\x09\x0a\x0c ") >> afterAttrName tag attrs name)
150 id $ (satisfy (inClass "\x09\x0a\x0c ") >> afterAttrName tag attrs name)
151 <|> (char '/' >> selfClosingStartTag tag attrs)
151 <|> (char '/' >> selfClosingStartTag tag attrs)
152 <|> (char '=' >> beforeAttrValue tag attrs name)
152 <|> (char '=' >> beforeAttrValue tag attrs name)