aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Options.hs2
-rw-r--r--src/Text/Pandoc/Parsing.hs2
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs
index 063162718..64c3709e1 100644
--- a/src/Text/Pandoc/Options.hs
+++ b/src/Text/Pandoc/Options.hs
@@ -61,6 +61,7 @@ data ReaderOptions = ReaderOptions{
-- in parsing dashes; -- is em-dash;
-- - before numerial is en-dash
, readerLiterateHaskell :: Bool -- ^ Interpret as literate Haskell
+ , readerCitations :: [String] -- ^ List of available citations
} deriving (Show, Read)
instance Default ReaderOptions
@@ -73,4 +74,5 @@ instance Default ReaderOptions
, readerTabStop = 4
, readerOldDashes = False
, readerLiterateHaskell = False
+ , readerCitations = []
}
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index a266c527e..997316180 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -693,7 +693,6 @@ data ParserState = ParserState
stateMaxNestingLevel :: Int, -- ^ Max # of nested Strong/Emph
stateLastStrPos :: Maybe SourcePos, -- ^ Position after last str parsed
stateKeys :: KeyTable, -- ^ List of reference keys
- stateCitations :: [String], -- ^ List of available citations
stateNotes :: NoteTable, -- ^ List of notes
stateTitle :: [Inline], -- ^ Title of document
stateAuthors :: [[Inline]], -- ^ Authors of document
@@ -720,7 +719,6 @@ defaultParserState =
stateMaxNestingLevel = 6,
stateLastStrPos = Nothing,
stateKeys = M.empty,
- stateCitations = [],
stateNotes = [],
stateTitle = [],
stateAuthors = [],
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 4f1831baf..f6f23faed 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1405,8 +1405,8 @@ citeKey = try $ do
let internal p = try $ p >>~ lookAhead (letter <|> digit)
rest <- many $ letter <|> digit <|> internal (oneOf ":.#$%&-_?<>~")
let key = first:rest
- st <- getState
- guard $ key `elem` stateCitations st
+ citations' <- getOption readerCitations
+ guard $ key `elem` citations'
return (suppress_author, key)
suffix :: Parser [Char] ParserState [Inline]