aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorAlbert Krewinkel <tarleb@moltkeplatz.de>2014-04-19 13:15:47 +0200
committerAlbert Krewinkel <tarleb@moltkeplatz.de>2014-04-19 14:40:46 +0200
commit8e91d362a392d1ee90a497f39cfcf90fee8d8da0 (patch)
tree0fa7dee4df3304f672fb8aea1347966a41f3caa4 /src/Text
parenta69416091ba035ab1661ff306ef3e51fd926488b (diff)
downloadpandoc-8e91d362a392d1ee90a497f39cfcf90fee8d8da0.tar.gz
Org reader: Fix parsing of footnotes
Footnotes can consist of multiple blocks and end only at a header or at the beginning of another footnote. This fixes the previous behavior, which restricted notes to a single paragraph.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Org.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs
index 66211b20e..0bc0a2668 100644
--- a/src/Text/Pandoc/Readers/Org.hs
+++ b/src/Text/Pandoc/Readers/Org.hs
@@ -639,10 +639,14 @@ latexEnvName = try $ do
--
noteBlock :: OrgParser (F Blocks)
noteBlock = try $ do
- ref <- noteMarker
- content <- skipSpaces *> paraOrPlain
+ ref <- noteMarker <* skipSpaces
+ content <- mconcat <$> blocksTillHeaderOrNote
addToNotesTable (ref, content)
return mempty
+ where
+ blocksTillHeaderOrNote =
+ many1Till block (eof <|> () <$ lookAhead noteMarker
+ <|> () <$ lookAhead headerStart)
-- Paragraphs or Plain text
paraOrPlain :: OrgParser (F Blocks)