Markdown reader: improved handling of mmd link attributes in references.

Previously they only worked for links that had titles.  Closes #7080.
This commit is contained in:
John MacFarlane 2021-02-06 21:52:12 -08:00
parent 0ab3e4048c
commit 8e9131db4e
2 changed files with 10 additions and 0 deletions

View file

@ -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 '>')

8
test/command/7080.md Normal file
View file

@ -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","")]]
```