git.iko.soy/typeable/pandoc
on master help sign in
Add check to see whether in a footnote to ParserState (to avoid circular footnotes)
commit9ca34cc9a92eff7002e869378bac9e436c3decef authorMatthew Pickering <matthewtpickering@gmail.com> dateFri 30 Jan 2015, 12:32 (12 years ago) parentde093b4
1 file changed+4−2
src/Text/Pandoc/Parsing.hs+4−2
src/Text/Pandoc/Parsing.hs+4−2
@@ -908,7 +908,8 @@ data ParserState = ParserState
908908 stateCaption :: Maybe Inlines, -- ^ Caption in current environment
909909 stateInHtmlBlock :: Maybe String, -- ^ Tag type of HTML block being parsed
910910 stateMarkdownAttribute :: Bool, -- ^ True if in markdown=1 context
911− stateWarnings :: [String] -- ^ Warnings generated by the parser
911+ stateWarnings :: [String], -- ^ Warnings generated by the parser
912+ stateInFootnote :: Bool -- ^ True if in a footnote block.
912913 }
913914
914915instance Default ParserState where
@@ -1002,7 +1003,8 @@ defaultParserState =
10021003 stateCaption = Nothing,
10031004 stateInHtmlBlock = Nothing,
10041005 stateMarkdownAttribute = False,
1005− stateWarnings = []}
1006+ stateWarnings = [],
1007+ stateInFootnote = False }
10061008
10071009-- | Succeed only if the extension is enabled.
10081010guardEnabled :: (Stream s m a, HasReaderOptions st) => Extension -> ParserT s st m ()