From ca51bbbf166b8fd5d835426e1f499d251f2c110c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 11 Nov 2010 20:02:37 -0800 Subject: HTML reader: don't parse raw HTML inside tag. Previously 'x' would be parsed as Code "x", which is not what you want. --- src/Text/Pandoc/Readers/HTML.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index f47309d3f..5ccbc4fb1 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -686,8 +686,8 @@ inline = choice [ charRef code :: GenParser Char ParserState Inline code = try $ do - result <- (htmlOpenTag "code" >> manyTill anyChar (htmlEndTag "code")) - <|> (htmlOpenTag "tt" >> manyTill anyChar (htmlEndTag "tt")) + result <- (htmlOpenTag "code" >> manyTill (noneOf "<>") (htmlEndTag "code")) + <|> (htmlOpenTag "tt" >> manyTill (noneOf "<>") (htmlEndTag "tt")) -- remove internal line breaks, leading and trailing space, -- and decode character references return $ Code $ decodeCharacterReferences $ removeLeadingTrailingSpace $ -- cgit v1.2.3