git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: Parse bracketed text in inline footnotes. Previously,

"test^[my [note] contains brackets]" would yield a note with contents "my [note". Now it yields a note with contents "my [note] contains brackets". New function: inlinesInBrackets. Resolves Issue 14. git-svn-id: https://pandoc.googlecode.com/svn/trunk@665 788f1e2b-df1e-0410-8736-df70ead52e1b

commit1780228b7c93757fbb826955a849dcd752235c80 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 9 Jul 2007, 06:51 (19 years ago) parentd58dca5
1 file changed+10−2
src/Text/Pandoc/Readers/Markdown.hs+10−2
src/Text/Pandoc/Readers/Markdown.hs+10−2
@@ -1011,11 +1011,19 @@ note = try $ do
10111011 Nothing -> fail "note not found"
10121012 Just contents -> return (Note contents)
10131013
1014+inlinesInBrackets = try $ do
1015+ char '['
1016+ results <- many $ count 1 (choice [link, referenceLink, image]) <|>
1017+ try (do{res <- inlinesInBrackets; return
1018+ ([Str "["] ++ res ++ [Str "]"])}) <|>
1019+ (do{notFollowedBy (char ']'); count 1 inline})
1020+ char ']'
1021+ return $ concat results
1022+
10141023inlineNote = try $ do
10151024 failIfStrict
10161025 char noteStart
1017− char labelStart
1018− contents <- manyTill inline (char labelEnd)
1026+ contents <- inlinesInBrackets
10191027 return (Note [Para contents])
10201028
10211029rawLaTeXInline' = do