@@ -196,7 +196,14 @@ htmlScript = try $ do
196196 rest <- manyTill anyChar (htmlEndTag "script")
197197 return $ open ++ rest ++ "</script>"
198198
199−htmlBlockElement = choice [ htmlScript, htmlComment, xmlDec, definition ]
199+-- | Parses material between style tags.
200+-- Style tags must be treated differently, because they can contain CSS
201+htmlStyle = try $ do
202+ open <- string "<style"
203+ rest <- manyTill anyChar (htmlEndTag "style")
204+ return $ open ++ rest ++ "</style>"
205+
206+htmlBlockElement = choice [ htmlScript, htmlStyle, htmlComment, xmlDec, definition ]
200207
201208rawHtmlBlock = try $ do
202209 body <- htmlBlockElement <|> anyHtmlTag <|> anyHtmlEndTag
@@ -435,7 +442,7 @@ code = try $ do
435442 joinWithSep " " $ lines result
436443
437444rawHtmlInline = do
438− result <- htmlScript <|> htmlComment <|> anyHtmlInlineTag
445+ result <- htmlScript <|> htmlStyle <|> htmlComment <|> anyHtmlInlineTag
439446 state <- getState
440447 if stateParseRaw state then return (HtmlInline result) else return (Str "")
441448