git.iko.soy/typeable/pandoc
on master help sign in
Improved fix to markdown noteBlock parser.

The last patch did not handle cases with > 4 spaces. Also added a more general test case.

commite898f0abef48a79d5bf64a8c17cdf94cf8f1b258 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 31 Jan 2011, 20:42 (16 years ago) parentf282b46
2 files changed+4−9
src/Tests/Readers/Markdown.hs+3−8 src/Text/Pandoc/Readers/Markdown.hs+1−1
src/Tests/Readers/Markdown.hs+3−8
@@ -27,13 +27,8 @@ tests = [ testGroup "inline code"
2727 =?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
2828 ]
2929 , 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"
30+ [ "indent followed by newline" =:
31+ "[^1]\n\n[^1]: my note\n\n \nnot in note\n"
32+ =?> para (note (para "my note")) +++ para "not in note"
3833 ]
3934 ]
src/Text/Pandoc/Readers/Markdown.hs+1−1
@@ -264,7 +264,7 @@ noteBlock = try $ do
264264 optional blankline
265265 optional indentSpaces
266266 raw <- sepBy rawLines (try (blankline >> indentSpaces >>
267− notFollowedBy newline))
267+ notFollowedBy blankline))
268268 optional blanklines
269269 endPos <- getPosition
270270 let newnote = (ref, (intercalate "\n" raw) ++ "\n\n")