@@ -320,10 +320,22 @@ htmlBlockElement = choice [ htmlScript, htmlStyle, htmlComment, xmlDec, definiti
321rawHtmlBlock :: GenParser Char ParserState Block
321rawHtmlBlock :: GenParser Char ParserState Block
322rawHtmlBlock = try $ do
322rawHtmlBlock = try $ do
323− body <- htmlBlockElement <|> anyHtmlBlockTag
323+ body <- htmlBlockElement <|> rawVerbatimBlock <|> anyHtmlBlockTag
324 state <- getState
324 state <- getState
325 if stateParseRaw state then return (RawHtml body) else return Null
325 if stateParseRaw state then return (RawHtml body) else return Null
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"]
334+ contents <- many (notFollowedBy' (htmlEndTag tagtype) >> anyChar)
335+ end <- htmlEndTag tagtype
336+ return $ start ++ contents ++ end
337+ else fail "Not a verbatim block"
327-- We don't want to parse </body> or </html> as raw HTML, since these
339-- We don't want to parse </body> or </html> as raw HTML, since these
328-- are handled in parseHtml.
340-- are handled in parseHtml.
329rawHtmlBlock' :: GenParser Char ParserState Block
341rawHtmlBlock' :: GenParser Char ParserState Block