aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2015-01-30 12:32:45 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2015-03-22 20:11:30 +0000
commit9ca34cc9a92eff7002e869378bac9e436c3decef (patch)
tree0320dc4e92c7ae6bf9e6b871674edb022f9101f9 /src/Text
parentde093b4e6ee7fa135f8551699bc2674571ba4dda (diff)
downloadpandoc-9ca34cc9a92eff7002e869378bac9e436c3decef.tar.gz
Add check to see whether in a footnote to ParserState (to avoid circular footnotes)
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Parsing.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index 8f1d1086d..592f377c6 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -908,7 +908,8 @@ data ParserState = ParserState
stateCaption :: Maybe Inlines, -- ^ Caption in current environment
stateInHtmlBlock :: Maybe String, -- ^ Tag type of HTML block being parsed
stateMarkdownAttribute :: Bool, -- ^ True if in markdown=1 context
- stateWarnings :: [String] -- ^ Warnings generated by the parser
+ stateWarnings :: [String], -- ^ Warnings generated by the parser
+ stateInFootnote :: Bool -- ^ True if in a footnote block.
}
instance Default ParserState where
@@ -1002,7 +1003,8 @@ defaultParserState =
stateCaption = Nothing,
stateInHtmlBlock = Nothing,
stateMarkdownAttribute = False,
- stateWarnings = []}
+ stateWarnings = [],
+ stateInFootnote = False }
-- | Succeed only if the extension is enabled.
guardEnabled :: (Stream s m a, HasReaderOptions st) => Extension -> ParserT s st m ()