diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-11-05 21:14:20 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-11-05 21:14:20 +0100 |
commit | eced02d70e0a4e8d7dfa4c373a6c4d8a4cc08407 (patch) | |
tree | e8a73f71e7d3f6c7627c373e131baaff5ed9931c /src | |
parent | 7db4dd46dc2fba2cb3ec2a6c3191c3147b2b215f (diff) | |
download | pandoc-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.hs | 3 |
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 |