From d8762eb43662ca8d099d831d454abe402a8fc10a Mon Sep 17 00:00:00 2001
From: fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>
Date: Mon, 23 Jul 2007 02:50:29 +0000
Subject: [PATCH] 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
---
 src/Text/Pandoc/Readers/HTML.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 8fff78ac1..270c7ba21 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -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"