diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 36bb3f760..eb771efe6 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -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 |