aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-11-11 20:02:37 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-11-11 20:02:37 -0800
commitca51bbbf166b8fd5d835426e1f499d251f2c110c (patch)
treef8566d4900f9482810ca9d6479138df544e587cf /src/Text/Pandoc
parent21556e37f4596cd7020337f1a8f039364c47c04b (diff)
downloadpandoc-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.hs4
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 $