In HTML reader, filter Nulls in lists of blocks. (These can

be caused by raw HTML when the parse-raw option isn't selected.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@787 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2007-07-23 02:50:29 +00:00
parent 9f871ab1ec
commit d8762eb436

View file

@ -76,7 +76,7 @@ inlineHtmlTags = ["a", "abbr", "acronym", "b", "basefont", "bdo", "big",
-- | Read blocks until end tag.
blocksTilEnd tag = try (do
blocks <- manyTill (do {b <- block; spaces; return b}) (htmlEndTag tag)
return blocks)
return $ filter (/= Null) blocks)
-- | Read inlines until end tag.
inlinesTilEnd tag = try (do
@ -288,7 +288,7 @@ parseHtml = do
parseBlocks = do
spaces
result <- sepEndBy block spaces
return result
return $ filter (/= Null) result
block = choice [ codeBlock, header, hrule, list, blockQuote, para, plain,
rawHtmlBlock ] <?> "block"