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:
parent
21e56042c8
commit
f282b462bb
2 changed files with 12 additions and 1 deletions
|
@ -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"
|
||||
]
|
||||
]
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue