Add check to see whether in a footnote to ParserState (to avoid circular footnotes)
This commit is contained in:
parent
de093b4e6e
commit
9ca34cc9a9
1 changed files with 4 additions and 2 deletions
|
@ -908,7 +908,8 @@ data ParserState = ParserState
|
||||||
stateCaption :: Maybe Inlines, -- ^ Caption in current environment
|
stateCaption :: Maybe Inlines, -- ^ Caption in current environment
|
||||||
stateInHtmlBlock :: Maybe String, -- ^ Tag type of HTML block being parsed
|
stateInHtmlBlock :: Maybe String, -- ^ Tag type of HTML block being parsed
|
||||||
stateMarkdownAttribute :: Bool, -- ^ True if in markdown=1 context
|
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
|
instance Default ParserState where
|
||||||
|
@ -1002,7 +1003,8 @@ defaultParserState =
|
||||||
stateCaption = Nothing,
|
stateCaption = Nothing,
|
||||||
stateInHtmlBlock = Nothing,
|
stateInHtmlBlock = Nothing,
|
||||||
stateMarkdownAttribute = False,
|
stateMarkdownAttribute = False,
|
||||||
stateWarnings = []}
|
stateWarnings = [],
|
||||||
|
stateInFootnote = False }
|
||||||
|
|
||||||
-- | Succeed only if the extension is enabled.
|
-- | Succeed only if the extension is enabled.
|
||||||
guardEnabled :: (Stream s m a, HasReaderOptions st) => Extension -> ParserT s st m ()
|
guardEnabled :: (Stream s m a, HasReaderOptions st) => Extension -> ParserT s st m ()
|
||||||
|
|
Loading…
Reference in a new issue