Markdown reader: Fixed whitespace footnote bug (Jesse Rosenthal).
The problem was in input like this:
[^1]: note
not in note.
Also added a test case for this.
commitf282b462bb81b271604c533ea176a1e6fde52b12
authorJohn MacFarlane <jgm@berkeley.edu>
dateMon 31 Jan 2011, 20:05 (16 years ago)
parent21e5604
src/Tests/Readers/Markdown.hs+10
@@ -26,4 +26,14 @@ tests = [ testGroup "inline code"
2626 "`*` {.haskell .special x=\"7\"}"
2727 =?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
2828 ]
29+ , testGroup "footnotes"
30+ [ "indent followed by newline" =: [_LIT|
31+[^1]
32+
33+[^1]: my note
34+
35+
36+not in note
37+|] =?> para (note (para "my note")) +++ para "not in note"
38+ ]
2939 ]
src/Text/Pandoc/Readers/Markdown.hs+2−1
@@ -263,7 +263,8 @@ noteBlock = try $ do
263263 char ':'
264264 optional blankline
265265 optional indentSpaces
266− raw <- sepBy rawLines (try (blankline >> indentSpaces))
266+ raw <- sepBy rawLines (try (blankline >> indentSpaces >>
267+ notFollowedBy newline))
267268 optional blanklines
268269 endPos <- getPosition
269270 let newnote = (ref, (intercalate "\n" raw) ++ "\n\n")