aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-07 21:00:57 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-07 21:00:57 -0700
commit2c0e989f9df788b7f168159fd99d5c3e1a78aa85 (patch)
treeedd708786e39d420ed6fb41bc9c005ebc945e56f /src
parentfd23b6dbce073722931634e04ed6c9c8b851f37c (diff)
downloadpandoc-2c0e989f9df788b7f168159fd99d5c3e1a78aa85.tar.gz
Markdown reader: fixed spurious parsing as citation as reference def.
We now disallow reference keys starting with `@` if the `citations` extension is enabled. Closes #3840.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index d7e59c7fd..1bcf1cfae 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1695,8 +1695,10 @@ endline = try $ do
-- a reference label for a link
reference :: PandocMonad m => MarkdownParser m (F Inlines, String)
-reference = do notFollowedBy' (string "[^") -- footnote reference
- withRaw $ trimInlinesF <$> inlinesInBalancedBrackets
+reference = do
+ guardDisabled Ext_footnotes <|> notFollowedBy' (string "[^")
+ guardDisabled Ext_citations <|> notFollowedBy' (string "[@")
+ withRaw $ trimInlinesF <$> inlinesInBalancedBrackets
parenthesizedChars :: PandocMonad m => MarkdownParser m [Char]
parenthesizedChars = do