aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-31 20:42:49 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-31 20:42:49 -0800
commite898f0abef48a79d5bf64a8c17cdf94cf8f1b258 (patch)
tree6dd345d1496cf8916c82d473d5f33ec301b77ff0
parentf282b462bb81b271604c533ea176a1e6fde52b12 (diff)
downloadpandoc-e898f0abef48a79d5bf64a8c17cdf94cf8f1b258.tar.gz
Improved fix to markdown noteBlock parser.
The last patch did not handle cases with > 4 spaces. Also added a more general test case.
-rw-r--r--src/Tests/Readers/Markdown.hs11
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs2
2 files changed, 4 insertions, 9 deletions
diff --git a/src/Tests/Readers/Markdown.hs b/src/Tests/Readers/Markdown.hs
index 021ef7fa5..bfd3602e0 100644
--- a/src/Tests/Readers/Markdown.hs
+++ b/src/Tests/Readers/Markdown.hs
@@ -27,13 +27,8 @@ tests = [ testGroup "inline code"
=?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
]
, testGroup "footnotes"
- [ "indent followed by newline" =: [_LIT|
-[^1]
-
-[^1]: my note
-
-
-not in note
-|] =?> para (note (para "my note")) +++ para "not in note"
+ [ "indent followed by newline" =:
+ "[^1]\n\n[^1]: my note\n\n \nnot in note\n"
+ =?> para (note (para "my note")) +++ para "not in note"
]
]
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 6a9753987..2bfb742bd 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -264,7 +264,7 @@ noteBlock = try $ do
optional blankline
optional indentSpaces
raw <- sepBy rawLines (try (blankline >> indentSpaces >>
- notFollowedBy newline))
+ notFollowedBy blankline))
optional blanklines
endPos <- getPosition
let newnote = (ref, (intercalate "\n" raw) ++ "\n\n")