From abf2dc78ac2ba635547ec288f264491d7bc26978 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 5 Aug 2008 23:18:52 +0000 Subject: Allow parsing of multiline citations. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1381 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Readers/Markdown.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Text/Pandoc/Readers') diff --git a/Text/Pandoc/Readers/Markdown.hs b/Text/Pandoc/Readers/Markdown.hs index 2bf53684f..088adb38b 100644 --- a/Text/Pandoc/Readers/Markdown.hs +++ b/Text/Pandoc/Readers/Markdown.hs @@ -1177,14 +1177,14 @@ chkCit t = do else return $ Nothing citeMarker :: GenParser Char ParserState String -citeMarker = string "[" >> manyTill (noneOf "\t\n") (string "]") +citeMarker = string "[" >> manyTill anyChar (try $ string "]") parseCitation :: GenParser Char ParserState [(String,String)] parseCitation = try $ sepBy (parseLabel) (oneOf ";") parseLabel :: GenParser Char ParserState (String,String) parseLabel = try $ do - res <- sepBy (skipSpaces >> many1 (noneOf "@;\n\t")) (oneOf "@") + res <- sepBy (skipMany (oneOf "\t\n ") >> many1 (noneOf "@;")) (oneOf "@") case res of [lab,loc] -> return (lab, loc) [lab] -> return (lab, "" ) -- cgit v1.2.3