diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-04-17 18:35:49 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-04-17 18:35:49 -0700 |
commit | 13b230a1b57a448bfe26c4b7b889cd57698c20ec (patch) | |
tree | 871c2517848b5b0f6599b6aeb94bb2c9b00b1864 /src | |
parent | 0c5f57aab9e0ebfbc0fcafdb0fe3d2aed7a33183 (diff) | |
download | pandoc-13b230a1b57a448bfe26c4b7b889cd57698c20ec.tar.gz |
Fixed `htmlTag` in HTML reader.
Require that `<!` or `<?` be followed by nonspace.
This prevents `</ div>` from being parsed as a comment.
Closes #1820.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 2 |
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 |