git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: fixed spurious parsing as citation as reference def.
2c0e989John MacFarlane
src/Text/Pandoc/Readers/Markdown.hs+4−2
@@ -1695,8 +1695,10 @@ endline = try $ do
1695
1695
1696-- a reference label for a link
1696-- a reference label for a link
1697reference :: PandocMonad m => MarkdownParser m (F Inlines, String)
1697reference :: PandocMonad m => MarkdownParser m (F Inlines, String)
1698+reference = do
1698−reference = do notFollowedBy' (string "[^") -- footnote reference
1699+ guardDisabled Ext_footnotes <|> notFollowedBy' (string "[^")
1700+ guardDisabled Ext_citations <|> notFollowedBy' (string "[@")
1699− withRaw $ trimInlinesF <$> inlinesInBalancedBrackets
1701+ withRaw $ trimInlinesF <$> inlinesInBalancedBrackets
1700
1702
1701parenthesizedChars :: PandocMonad m => MarkdownParser m [Char]
1703parenthesizedChars :: PandocMonad m => MarkdownParser m [Char]
1702parenthesizedChars = do
1704parenthesizedChars = do
test/command/3840.mdnew file+15
@@ -0,0 +1,15 @@
1+```
2+% pandoc
3+[@Alhazen1572-qk, V.9]: "competentius est"
4+^D
5+<p><span class="citation" data-cites="Alhazen1572-qk">[@Alhazen1572-qk, V.9]</span>: “competentius est”</p>
6+```
7+
8+```
9+% pandoc -f markdown-citations
10+[@Alhazen1572-qk, V.9]: "competentius est"
11+
12+[@Alhazen1572-qk, V.9]
13+^D
14+<p><a href="" title="competentius est">@Alhazen1572-qk, V.9</a></p>
15+```