@@ -100,7 +100,7 @@ extractTagType ('<':rest) =
100 map toLower $ takeWhile isAlphaNum $ dropWhile isSpaceOrSlash rest
100 map toLower $ takeWhile isAlphaNum $ dropWhile isSpaceOrSlash rest
101extractTagType _ = ""
101extractTagType _ = ""
103−-- | Parse any HTML tag (closing or opening) and return text of tag
103+-- | Parse any HTML tag (opening or self-closing) and return text of tag
104anyHtmlTag = try $ do
104anyHtmlTag = try $ do
@@ -313,15 +313,16 @@ hrule = try $ do
313-- code blocks
313-- code blocks
316+-- Note: HTML tags in code blocks (e.g. for syntax highlighting) are
317+-- skipped, because they are not portable to output formats other than HTML.
316codeBlock = try $ do
318codeBlock = try $ do
317 htmlTag "pre"
319 htmlTag "pre"
320− result <- manyTill anyChar (htmlEndTag "code")
320+ result <- manyTill
321− spaces
321+ (many1 (satisfy (/= '<')) <|>
322+ ((anyHtmlTag <|> anyHtmlEndTag) >> return ""))
322− htmlEndTag "pre"
323+ (htmlEndTag "pre")
323 return $ CodeBlock $ stripTrailingNewlines $
324 return $ CodeBlock $ stripTrailingNewlines $
324− decodeCharacterReferences result
325+ decodeCharacterReferences $ concat result
327-- block quotes
328-- block quotes