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.
This commit is contained in:
John MacFarlane 2011-01-31 20:05:11 -08:00
parent 21e56042c8
commit f282b462bb
2 changed files with 12 additions and 1 deletions

View file

@ -26,4 +26,14 @@ tests = [ testGroup "inline code"
"`*` {.haskell .special x=\"7\"}"
=?> 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"
]
]

View file

@ -263,7 +263,8 @@ noteBlock = try $ do
char ':'
optional blankline
optional indentSpaces
raw <- sepBy rawLines (try (blankline >> indentSpaces))
raw <- sepBy rawLines (try (blankline >> indentSpaces >>
notFollowedBy newline))
optional blanklines
endPos <- getPosition
let newnote = (ref, (intercalate "\n" raw) ++ "\n\n")