summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-04-17 18:35:49 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-04-17 18:35:49 -0700
commit13b230a1b57a448bfe26c4b7b889cd57698c20ec (patch)
tree871c2517848b5b0f6599b6aeb94bb2c9b00b1864
parent0c5f57aab9e0ebfbc0fcafdb0fe3d2aed7a33183 (diff)
Fixed `htmlTag` in HTML reader.
Require that `<!` or `<?` be followed by nonspace. This prevents `</ div>` from being parsed as a comment. Closes #1820.
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 59f71589e..52358e51e 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -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