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
This commit is contained in:
parent
d58dca502e
commit
1780228b7c
1 changed files with 10 additions and 2 deletions
|
@ -1011,11 +1011,19 @@ note = try $ do
|
|||
Nothing -> fail "note not found"
|
||||
Just contents -> return (Note contents)
|
||||
|
||||
inlinesInBrackets = try $ do
|
||||
char '['
|
||||
results <- many $ count 1 (choice [link, referenceLink, image]) <|>
|
||||
try (do{res <- inlinesInBrackets; return
|
||||
([Str "["] ++ res ++ [Str "]"])}) <|>
|
||||
(do{notFollowedBy (char ']'); count 1 inline})
|
||||
char ']'
|
||||
return $ concat results
|
||||
|
||||
inlineNote = try $ do
|
||||
failIfStrict
|
||||
char noteStart
|
||||
char labelStart
|
||||
contents <- manyTill inline (char labelEnd)
|
||||
contents <- inlinesInBrackets
|
||||
return (Note [Para contents])
|
||||
|
||||
rawLaTeXInline' = do
|
||||
|
|
Loading…
Add table
Reference in a new issue