git.iko.soy/typeable/pandoc
on master help sign in
Add check to see whether in a footnote to ParserState (to avoid circular footnotes)
9ca34ccMatthew Pickering
src/Text/Pandoc/Parsing.hs+4−2
@@ -908,7 +908,8 @@ data ParserState = ParserState
908 stateCaption :: Maybe Inlines, -- ^ Caption in current environment
908 stateCaption :: Maybe Inlines, -- ^ Caption in current environment
909 stateInHtmlBlock :: Maybe String, -- ^ Tag type of HTML block being parsed
909 stateInHtmlBlock :: Maybe String, -- ^ Tag type of HTML block being parsed
910 stateMarkdownAttribute :: Bool, -- ^ True if in markdown=1 context
910 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.
912 }
913 }
913
914
914instance Default ParserState where
915instance Default ParserState where
@@ -1002,7 +1003,8 @@ defaultParserState =
1002 stateCaption = Nothing,
1003 stateCaption = Nothing,
1003 stateInHtmlBlock = Nothing,
1004 stateInHtmlBlock = Nothing,
1004 stateMarkdownAttribute = False,
1005 stateMarkdownAttribute = False,
1005− stateWarnings = []}
1006+ stateWarnings = [],
1007+ stateInFootnote = False }
1006
1008
1007-- | Succeed only if the extension is enabled.
1009-- | Succeed only if the extension is enabled.
1008guardEnabled :: (Stream s m a, HasReaderOptions st) => Extension -> ParserT s st m ()
1010guardEnabled :: (Stream s m a, HasReaderOptions st) => Extension -> ParserT s st m ()