git.iko.soy/typeable/html-parse
on master help sign in
Avoid notInClass in comment
commitb426b3e9602fcc8b5df6c8da66935c854536f376 authorBen Gamari <ben@smart-cactus.org> dateFri 2 Feb 2018, 20:59 (9 years ago) parent4678ed2
1 file changed+1−1
Text/HTML/Parser.hs+1−1
Text/HTML/Parser.hs+1−1
@@ -270,7 +270,7 @@ commentStartDash =
270270-- | /§8.2.4.45/: Comment state
271271comment :: Builder -> Parser Token
272272comment content0 = do
273− content <- B.fromText <$> takeWhile (notInClass "-\x00<")
273+ content <- B.fromText <$> takeWhile (not . (isC '-' `orC` isC '\x00' `orC` isC '<'))
274274 id $ (char '<' >> commentLessThan (content0 <> content <> "<"))
275275 <|> (char '-' >> commentEndDash (content0 <> content))
276276 <|> (char '\x00' >> comment (content0 <> content <> B.singleton '\xfffd'))