@@ -507,11 +507,18 @@ strictHtmlBlock = try $ do
507 return $ tag ++ concat contents ++ end
507 return $ tag ++ concat contents ++ end
509rawHtmlBlocks = do
509rawHtmlBlocks = do
510− htmlBlocks <- many1 rawHtmlBlock
510+ htmlBlocks <- many1 $ do (RawHtml blk) <- rawHtmlBlock
511− let combined = concatMap (\(RawHtml str) -> str) htmlBlocks
511+ sps <- do sp1 <- many spaceChar
512+ sp2 <- option "" (blankline >> return "\n")
513+ sp3 <- many spaceChar
514+ sp4 <- option "" blanklines
515+ return $ sp1 ++ sp2 ++ sp3 ++ sp4
516+ -- note: we want raw html to be able to
517+ -- precede a code block, when separated
520+ let combined = concat htmlBlocks
512− let combined' = if not (null combined) && last combined == '\n'
521+ let combined' = if last combined == '\n' then init combined else combined
513− then init combined -- strip extra newline
515 return $ RawHtml combined'
522 return $ RawHtml combined'