@@ -291,11 +291,11 @@ noteBlock = try $ do
292 optional blankline
292 optional blankline
293 optional indentSpaces
293 optional indentSpaces
294− raw <- sepBy rawLines
294+ first <- rawLines
295− (try (blankline >> indentSpaces >>
295+ rest <- many $ try $ blanklines >> indentSpaces >> rawLines
296− notFollowedBy blankline))
296+ let raw = unlines (first:rest) ++ "\n"
297 optional blanklines
297 optional blanklines
298− parsed <- parseFromString parseBlocks $ unlines raw ++ "\n"
298+ parsed <- parseFromString parseBlocks raw
299 let newnote = (ref, parsed)
299 let newnote = (ref, parsed)
300 updateState $ \s -> s { stateNotes' = newnote : stateNotes' s }
300 updateState $ \s -> s { stateNotes' = newnote : stateNotes' s }
301 return mempty
301 return mempty
@@ -517,10 +517,13 @@ emailBlockQuoteStart = try $ skipNonindentSpaces >> char '>' >>~ optional (char
517emailBlockQuote :: Parser [Char] ParserState [String]
517emailBlockQuote :: Parser [Char] ParserState [String]
518emailBlockQuote = try $ do
518emailBlockQuote = try $ do
519 emailBlockQuoteStart
519 emailBlockQuoteStart
520− raw <- sepBy (many (nonEndline <|>
520+ let emailLine = many $ nonEndline <|> try
521− (try (endline >> notFollowedBy emailBlockQuoteStart >>
521+ (endline >> notFollowedBy emailBlockQuoteStart >>
522− return '\n'))))
522+ return '\n')
523− (try (newline >> emailBlockQuoteStart))
523+ let emailSep = try (newline >> emailBlockQuoteStart)
525+ rest <- many $ try $ emailSep >> emailLine
526+ let raw = first:rest
524 newline <|> (eof >> return '\n')
527 newline <|> (eof >> return '\n')
525 optional blanklines
528 optional blanklines
526 return raw
529 return raw