aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-04-28 22:03:01 -0700
committerJohn MacFarlane <[email protected]>2023-04-28 22:03:01 -0700
commita34a4d8e4a06f3595be30dcd117bb204838335e2 (patch)
tree29db8e1f6ebe3e42f29a132b0fadbd320791bb72
parent16be353077d135d452a4ac63ff4210d13610ffbd (diff)
Commonmark writer: use shortcut reference links.
Commonmark supports these.
-rw-r--r--src/Text/Pandoc/Writers/Markdown/Inline.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs
index e7be4fc21..235e521be 100644
--- a/src/Text/Pandoc/Writers/Markdown/Inline.hs
+++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs
@@ -657,7 +657,8 @@ inlineToMarkdown opts lnk@(Link attr@(ident,classes,kvs) txt (src, tit)) = do
let useRefLinks = writerReferenceLinks opts && not useAuto
shortcutable <- asks envRefShortcutable
let useShortcutRefLinks = shortcutable &&
- isEnabled Ext_shortcut_reference_links opts
+ (variant == Commonmark ||
+ isEnabled Ext_shortcut_reference_links opts)
reftext <- if useRefLinks
then literal <$> getReference attr linktext (src, tit)
else return mempty