diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-23 02:50:29 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-23 02:50:29 +0000 |
commit | d8762eb43662ca8d099d831d454abe402a8fc10a (patch) | |
tree | a8eb9369ac7d1fe38415f659c82b480ed3b62b91 /src/Text/Pandoc/Readers | |
parent | 9f871ab1ec59f7c67a71263979a27792780dc5f7 (diff) | |
download | pandoc-d8762eb43662ca8d099d831d454abe402a8fc10a.tar.gz |
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
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 4 |
1 files 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" |