aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-11-05 21:14:20 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2016-11-05 21:14:20 +0100
commiteced02d70e0a4e8d7dfa4c373a6c4d8a4cc08407 (patch)
treee8a73f71e7d3f6c7627c373e131baaff5ed9931c /src
parent7db4dd46dc2fba2cb3ec2a6c3191c3147b2b215f (diff)
downloadpandoc-eced02d70e0a4e8d7dfa4c373a6c4d8a4cc08407.tar.gz
Markdown reader: Allow reference link labels starting with @...
...if citations extension disabled. Example: in [link text][@a] [@a]: url `link text` isn't hyperlinked because `[@a]` is parsed as a citation. Previously this happened whether or not the `citations` extension was enabled. Now it happens only if the `citations` extension is enabled. Closes #3209.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index f020e1bee..6c30fe3c3 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1774,7 +1774,8 @@ referenceLink :: (Attr -> String -> String -> Inlines -> Inlines)
referenceLink constructor (lab, raw) = do
sp <- (True <$ lookAhead (char ' ')) <|> return False
(_,raw') <- option (mempty, "") $
- lookAhead (try (spnl >> normalCite >> return (mempty, "")))
+ lookAhead (try (guardEnabled Ext_citations >>
+ spnl >> normalCite >> return (mempty, "")))
<|>
try (spnl >> reference)
when (raw' == "") $ guardEnabled Ext_shortcut_reference_links