git.iko.soy/typeable/pandoc
on master help sign in
Modified rawHtmlBlock in HTML reader so it parses </html> and </body> tags.

This allows these tags to be handled correctly in Markdown. HTML reader now uses rawHtmlBlock', which excludes </html> and </body>, since these are handled in parseHtml. (Resolves Issue #38.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@1152 788f1e2b-df1e-0410-8736-df70ead52e1b

commit6802d287cf8a5ad5423521520b5d16287e991536 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 23 Dec 2007, 03:46 (19 years ago) parentfbecb49
1 file changed+7−2
Text/Pandoc/Readers/HTML.hs+7−2
Text/Pandoc/Readers/HTML.hs+7−2
@@ -199,12 +199,16 @@ htmlScript = try $ do
199199htmlBlockElement = choice [ htmlScript, htmlComment, xmlDec, definition ]
200200
201201rawHtmlBlock = try $ do
202− notFollowedBy' (htmlTag "/body" <|> htmlTag "/html")
203202 body <- htmlBlockElement <|> anyHtmlTag <|> anyHtmlEndTag
204203 sp <- many space
205204 state <- getState
206205 if stateParseRaw state then return (RawHtml (body ++ sp)) else return Null
207206
207+-- We don't want to parse </body> or </html> as raw HTML, since these
208+-- are handled in parseHtml.
209+rawHtmlBlock' = do notFollowedBy' (htmlTag "/body" <|> htmlTag "/html")
210+ rawHtmlBlock
211+
208212-- | Parses an HTML comment.
209213htmlComment = try $ do
210214 string "<!--"
@@ -284,7 +288,8 @@ block = choice [ codeBlock
284288 , blockQuote
285289 , para
286290 , plain
287− , rawHtmlBlock ] <?> "block"
291+ , rawHtmlBlock'
292+ ] <?> "block"
288293
289294--
290295-- header blocks