aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index a1f069059..adf24588b 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -291,11 +291,11 @@ noteBlock = try $ do
char ':'
optional blankline
optional indentSpaces
- raw <- sepBy rawLines
- (try (blankline >> indentSpaces >>
- notFollowedBy blankline))
+ first <- rawLines
+ rest <- many $ try $ blanklines >> indentSpaces >> rawLines
+ let raw = unlines (first:rest) ++ "\n"
optional blanklines
- parsed <- parseFromString parseBlocks $ unlines raw ++ "\n"
+ parsed <- parseFromString parseBlocks raw
let newnote = (ref, parsed)
updateState $ \s -> s { stateNotes' = newnote : stateNotes' s }
return mempty
@@ -517,10 +517,13 @@ emailBlockQuoteStart = try $ skipNonindentSpaces >> char '>' >>~ optional (char
emailBlockQuote :: Parser [Char] ParserState [String]
emailBlockQuote = try $ do
emailBlockQuoteStart
- raw <- sepBy (many (nonEndline <|>
- (try (endline >> notFollowedBy emailBlockQuoteStart >>
- return '\n'))))
- (try (newline >> emailBlockQuoteStart))
+ let emailLine = many $ nonEndline <|> try
+ (endline >> notFollowedBy emailBlockQuoteStart >>
+ return '\n')
+ let emailSep = try (newline >> emailBlockQuoteStart)
+ first <- emailLine
+ rest <- many $ try $ emailSep >> emailLine
+ let raw = first:rest
newline <|> (eof >> return '\n')
optional blanklines
return raw