diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-11-11 20:02:37 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-11-11 20:02:37 -0800 |
commit | ca51bbbf166b8fd5d835426e1f499d251f2c110c (patch) | |
tree | f8566d4900f9482810ca9d6479138df544e587cf /src/Text/Pandoc | |
parent | 21556e37f4596cd7020337f1a8f039364c47c04b (diff) | |
download | pandoc-ca51bbbf166b8fd5d835426e1f499d251f2c110c.tar.gz |
HTML reader: don't parse raw HTML inside <code> tag.
Previously '<code><a>x</a></code>' would be parsed as
Code "<a>x</a>", which is not what you want.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 4 |
1 files changed, 2 insertions, 2 deletions
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 $ |