@@ -34,7 +34,7 @@ module Text.Pandoc.Readers.Markdown (
3434import Data.List ( transpose, isSuffixOf, sortBy, findIndex, intercalate )
3535import qualified Data.Map as M
3636import Data.Ord ( comparing )
37−import Data.Char ( isAlphaNum, isDigit )
37+import Data.Char ( isAlphaNum )
3838import Data.Maybe
3939import Text.Pandoc.Definition
4040import Text.Pandoc.Shared
@@ -1319,23 +1319,12 @@ spnl = try $ do
13191319 skipSpaces
13201320 notFollowedBy (char '\n')
13211321
1322−blankSpace :: GenParser Char st ()
1323−blankSpace = try $ do
1324− res <- many1 $ oneOf " \t\n"
1325− guard $ length res > 0
1326− guard $ length (filter (=='\n') res) <= 1
1327−
1328−noneOfUnlessEscaped :: [Char] -> GenParser Char st Char
1329−noneOfUnlessEscaped cs =
1330− try (char '\\' >> oneOf cs) <|> noneOf cs
1331−
13321322textualCite :: GenParser Char ParserState [Citation]
13331323textualCite = try $ do
13341324 (_, key) <- citeKey
13351325 let first = Citation{ citationId = key
13361326 , citationPrefix = []
13371327 , citationSuffix = []
1338− , citationLocator = ""
13391328 , citationMode = AuthorInText
13401329 , citationNoteNum = 0
13411330 , citationHash = 0
@@ -1349,12 +1338,11 @@ bareloc :: Citation -> GenParser Char ParserState [Citation]
13491338bareloc c = try $ do
13501339 spnl
13511340 char '['
1352− loc <- locator
13531341 suff <- suffix
13541342 rest <- option [] $ try $ char ';' >> citeList
13551343 spnl
13561344 char ']'
1357− return $ c{ citationLocator = loc, citationSuffix = suff } : rest
1345+ return $ c{ citationSuffix = suff } : rest
13581346
13591347normalCite :: GenParser Char ParserState [Citation]
13601348normalCite = try $ do
@@ -1376,26 +1364,6 @@ citeKey = try $ do
13761364 guard $ key `elem` stateCitations st
13771365 return (suppress_author, key)
13781366
1379−locator :: GenParser Char st String
1380−locator = try $ do
1381− spnl
1382− w <- many1 (noneOf " \t\n;,]")
1383− ws <- many (locatorWord <|> locatorComma)
1384− return $ unwords $ w:ws
1385−
1386−locatorWord :: GenParser Char st String
1387−locatorWord = try $ do
1388− spnl
1389− wd <- many1 $ noneOfUnlessEscaped "];, \t\n"
1390− guard $ any isDigit wd
1391− return wd
1392−
1393−locatorComma :: GenParser Char st String
1394−locatorComma = try $ do
1395− char ','
1396− lookAhead $ locatorWord
1397− return ","
1398−
13991367suffix :: GenParser Char ParserState [Inline]
14001368suffix = try $ do
14011369 spnl
@@ -1412,12 +1380,10 @@ citation :: GenParser Char ParserState Citation
14121380citation = try $ do
14131381 pref <- prefix
14141382 (suppress_author, key) <- citeKey
1415− loc <- option "" $ try $ blankSpace >> locator
14161383 suff <- suffix
14171384 return $ Citation{ citationId = key
14181385 , citationPrefix = pref
14191386 , citationSuffix = suff
1420− , citationLocator = loc
14211387 , citationMode = if suppress_author
14221388 then SuppressAuthor
14231389 else NormalCitation