git.iko.soy/typeable/pandoc
on master help sign in
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.

commiteced02d70e0a4e8d7dfa4c373a6c4d8a4cc08407 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 5 Nov 2016, 21:14 (10 years ago) parent7db4dd4
1 file changed+2−1
src/Text/Pandoc/Readers/Markdown.hs+2−1
src/Text/Pandoc/Readers/Markdown.hs+2−1
@@ -1774,7 +1774,8 @@ referenceLink :: (Attr -> String -> String -> Inlines -> Inlines)
17741774referenceLink constructor (lab, raw) = do
17751775 sp <- (True <$ lookAhead (char ' ')) <|> return False
17761776 (_,raw') <- option (mempty, "") $
1777− lookAhead (try (spnl >> normalCite >> return (mempty, "")))
1777+ lookAhead (try (guardEnabled Ext_citations >>
1778+ spnl >> normalCite >> return (mempty, "")))
17781779 <|>
17791780 try (spnl >> reference)
17801781 when (raw' == "") $ guardEnabled Ext_shortcut_reference_links