mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-26 10:16:32 +00:00
HTML reader: Don't interpret contents of style tags as markdown.
Resolves Issue #40. + Added htmlStyle, analagous to htmlScript. + Use htmlStyle in htmlBlockElement and rawHtmlInline. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1162 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
@@ -196,7 +196,14 @@ htmlScript = try $ do
|
||||
rest <- manyTill anyChar (htmlEndTag "script")
|
||||
return $ open ++ rest ++ "</script>"
|
||||
|
||||
htmlBlockElement = choice [ htmlScript, htmlComment, xmlDec, definition ]
|
||||
-- | Parses material between style tags.
|
||||
-- Style tags must be treated differently, because they can contain CSS
|
||||
htmlStyle = try $ do
|
||||
open <- string "<style"
|
||||
rest <- manyTill anyChar (htmlEndTag "style")
|
||||
return $ open ++ rest ++ "</style>"
|
||||
|
||||
htmlBlockElement = choice [ htmlScript, htmlStyle, htmlComment, xmlDec, definition ]
|
||||
|
||||
rawHtmlBlock = try $ do
|
||||
body <- htmlBlockElement <|> anyHtmlTag <|> anyHtmlEndTag
|
||||
@@ -435,7 +442,7 @@ code = try $ do
|
||||
joinWithSep " " $ lines result
|
||||
|
||||
rawHtmlInline = do
|
||||
result <- htmlScript <|> htmlComment <|> anyHtmlInlineTag
|
||||
result <- htmlScript <|> htmlStyle <|> htmlComment <|> anyHtmlInlineTag
|
||||
state <- getState
|
||||
if stateParseRaw state then return (HtmlInline result) else return (Str "")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user