From f176ad6f21aa02884f628082c05eecb76816d014 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 8 Oct 2017 14:17:26 +0200 Subject: Org reader: end footnotes after two blank lines Footnotes can not only be terminated by the start of a new footnote or a header, but also by two consecutive blank lines. --- src/Text/Pandoc/Readers/Org/Blocks.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs index 3e0ab0127..7f10195fe 100644 --- a/src/Text/Pandoc/Readers/Org/Blocks.hs +++ b/src/Text/Pandoc/Readers/Org/Blocks.hs @@ -724,13 +724,14 @@ latexEnd envName = try $ noteBlock :: PandocMonad m => OrgParser m (F Blocks) noteBlock = try $ do ref <- noteMarker <* skipSpaces <* updateLastPreCharPos - content <- mconcat <$> blocksTillHeaderOrNote + content <- mconcat <$> many1Till block endOfFootnote addToNotesTable (ref, content) return mempty where - blocksTillHeaderOrNote = - many1Till block (eof <|> () <$ lookAhead noteMarker - <|> () <$ lookAhead headerStart) + endOfFootnote = eof + <|> () <$ lookAhead noteMarker + <|> () <$ lookAhead headerStart + <|> () <$ lookAhead (try $ blankline *> blankline) -- Paragraphs or Plain text paraOrPlain :: PandocMonad m => OrgParser m (F Blocks) -- cgit v1.2.3