aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-02-06 21:52:12 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2021-02-06 21:52:12 -0800
commit8e9131db4edfda6deafdf94939b907e4dce3cbaa (patch)
tree5f414d3eb9510cfc49b8b2f1df2bd9f2e6527ebc
parent0ab3e4048c44b60fbecd7da3f43435f8c0cde49f (diff)
downloadpandoc-8e9131db4edfda6deafdf94939b907e4dce3cbaa.tar.gz
Markdown reader: improved handling of mmd link attributes in references.
Previously they only worked for links that had titles. Closes #7080.
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs2
-rw-r--r--test/command/7080.md8
2 files changed, 10 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 5c3a21bb7..e46553dd8 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -334,6 +334,8 @@ referenceKey = try $ do
skipMany spaceChar
notFollowedBy' referenceTitle
notFollowedBy' $ guardEnabled Ext_link_attributes >> attributes
+ notFollowedBy' $ guardEnabled Ext_mmd_link_attributes >>
+ try (spnl <* keyValAttr)
notFollowedBy' (() <$ reference)
many1Char $ notFollowedBy space >> litChar
let betweenAngles = try $ char '<' >> manyTillChar litChar (char '>')
diff --git a/test/command/7080.md b/test/command/7080.md
new file mode 100644
index 000000000..0727c1083
--- /dev/null
+++ b/test/command/7080.md
@@ -0,0 +1,8 @@
+```
+% pandoc -f markdown_mmd -t native
+![][image]
+
+[image]: image.png width=100px height=150px
+^D
+[Para [Image ("",[],[("width","100px"),("height","150px")]) [] ("image.png","")]]
+```