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 diff --git a/test/command/3840.md b/test/command/3840.md new file mode 100644 index 000000000..ceb1d1e51 --- /dev/null +++ b/test/command/3840.md @@ -0,0 +1,15 @@ +``` +% pandoc +[@Alhazen1572-qk, V.9]: "competentius est" +^D +

[@Alhazen1572-qk, V.9]: “competentius est”

+``` + +``` +% pandoc -f markdown-citations +[@Alhazen1572-qk, V.9]: "competentius est" + +[@Alhazen1572-qk, V.9] +^D +

@Alhazen1572-qk, V.9

+```