diff options
author | John MacFarlane <jgm@berkeley.edu> | 2012-09-15 15:46:16 -0400 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2012-09-15 15:46:16 -0400 |
commit | 887fc14f3d6f2909a2201769e4b8a54a8f6c8793 (patch) | |
tree | ba59072e3e8af300d72f5129831de58223505229 | |
parent | c5de3c411f1edac805a9fdd35f79f47d6aabbc9d (diff) | |
download | pandoc-887fc14f3d6f2909a2201769e4b8a54a8f6c8793.tar.gz |
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.
-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 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 |