summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-09-15 15:46:16 -0400
committerJohn MacFarlane <jgm@berkeley.edu>2012-09-15 15:46:16 -0400
commit887fc14f3d6f2909a2201769e4b8a54a8f6c8793 (patch)
treeba59072e3e8af300d72f5129831de58223505229 /src/Text
parentc5de3c411f1edac805a9fdd35f79f47d6aabbc9d (diff)
HTML reader: Modified htmlTag for fewer false positives.
A tag must start with `<` followed by `!`,`?`, `/`, or a letter. This makes it more useful in the wikimedia and markdown parsers.
Diffstat (limited to 'src/Text')
-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 295171ca8..424d9bdec 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -599,7 +599,7 @@ htmlInBalanced f = try $ do
-- | Matches a tag meeting a certain condition.
htmlTag :: (Tag String -> Bool) -> Parser [Char] st (Tag String, String)
htmlTag f = try $ do
- lookAhead (char '<')
+ lookAhead $ char '<' >> (oneOf "/!?" <|> letter)
(next : _) <- getInput >>= return . canonicalizeTags . parseTags
guard $ f next
-- advance the parser