Improved fix to markdown noteBlock parser.

The last patch did not handle cases with > 4 spaces.

Also added a more general test case.
This commit is contained in:
John MacFarlane 2011-01-31 20:42:49 -08:00
parent f282b462bb
commit e898f0abef
2 changed files with 4 additions and 9 deletions

View file

@ -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"
]
]

View file

@ -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")