Fixed htmlTag in HTML reader.

Require that `<!` or `<?` be followed by nonspace.
This prevents `</ div>` from being parsed as a comment.

Closes #1820.
This commit is contained in:
John MacFarlane 2015-04-17 18:35:49 -07:00
parent 0c5f57aab9
commit 13b230a1b5

View file

@ -887,7 +887,7 @@ htmlTag :: Monad m
=> (Tag String -> Bool)
-> ParserT [Char] st m (Tag String, String)
htmlTag f = try $ do
lookAhead $ char '<' >> (oneOf "/!?" <|> letter)
lookAhead $ char '<' >> ((oneOf "/!?" >> nonspaceChar) <|> letter)
(next : _) <- getInput >>= return . canonicalizeTags . parseTags
guard $ f next
-- advance the parser