@@ -320,10 +320,22 @@ htmlBlockElement = choice [ htmlScript, htmlStyle, htmlComment, xmlDec, definiti
320320
321321rawHtmlBlock :: GenParser Char ParserState Block
322322rawHtmlBlock = try $ do
323− body <- htmlBlockElement <|> anyHtmlBlockTag
323+ body <- htmlBlockElement <|> rawVerbatimBlock <|> anyHtmlBlockTag
324324 state <- getState
325325 if stateParseRaw state then return (RawHtml body) else return Null
326326
327+-- This is a block whose contents should be passed through verbatim, not interpreted.
328+rawVerbatimBlock :: GenParser Char ParserState [Char]
329+rawVerbatimBlock = try $ do
330+ start <- anyHtmlBlockTag
331+ let tagtype = extractTagType start
332+ if tagtype `elem` ["pre"]
333+ then do
334+ contents <- many (notFollowedBy' (htmlEndTag tagtype) >> anyChar)
335+ end <- htmlEndTag tagtype
336+ return $ start ++ contents ++ end
337+ else fail "Not a verbatim block"
338+
327339-- We don't want to parse </body> or </html> as raw HTML, since these
328340-- are handled in parseHtml.
329341rawHtmlBlock' :: GenParser Char ParserState Block