mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-21 23:15:52 +00:00
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:
@@ -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"
|
||||
]
|
||||
]
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user